Initializerswift-crypto 3.8.0Crypto
init
Creates a SHA1 hash function.
Insecure_HashFunctions.swift:66init()
Initialize a new hash function by calling this method if you want to hash the data iteratively, such as when you don’t have a buffer large enough to hold all the data at once. Provide data blocks to the hash function using the update(data:)
or update(bufferPointer:)
method. After providing all the data, call finalize
to get the digest.
If your data fits into a single buffer, you can use the hash(data:)
method instead, to compute the digest in a single call.
Other members in extension
Typealiases
typealias Digest
The digest type for a SHA1 hash function.
Type members
static var blockByteCount: Int
The number of bytes that represents the hash function’s internal state.
static var byteCount: Int
The number of bytes in a SHA1 digest.
Instance members
func finalize(
) -> `Self`.Digest Finalizes the hash function and returns the computed digest.
func update(bufferPointer: UnsafeRawBufferPointer
) Incrementally updates the hash function with the contents of the buffer.