Digest
public class Digest : Updatable
Public API for message digests.
Usage is straightforward
let s = "The quick brown fox jumps over the lazy dog."
var md5: Digest = Digest(using:.md5)
md5.update(s)
let digest = md5.final()
-
The status of the Digest. For CommonCrypto this will always be
.Success
. It is here to provide for engines which can fail.Declaration
Swift
public var status: Status
-
Enumerates available Digest algorithms
See moreDeclaration
Swift
public enum Algorithm
-
Create an algorithm-specific digest calculator
Declaration
Swift
public init(using algorithm: Algorithm)
Parameters
alrgorithm
the desired message digest algorithm
-
Low-level update routine. Updates the message digest calculation with the contents of a byte buffer.
Declaration
Swift
public func update(from buffer: UnsafeRawPointer, byteCount: size_t) -> `Self`?
Parameters
byteCount
Number of bytes in buffer
Return Value
This Digest object (for optional chaining)
-
Completes the calculate of the messge digest
Declaration
Swift
public func final() -> [UInt8]
Return Value
The message digest