SodiumGenericHash
struct SodiumGenericHash
A wrapper for generic hashing.
-
The initializer is disabled.
Declaration
Swift
fileprivate init() -
The default key size in bytes.
Declaration
Swift
let defaultKeySizeInBytes: Int -
The maximum key size in bytes.
Declaration
Swift
let minimumKeySizeInBytes: Int -
The minimum key size in bytes.
Declaration
Swift
let maximumKeySizeInBytes: Int -
The default output size in bytes.
Declaration
Swift
let defaultOutputSizeInBytes: Int -
The minimum output size in bytes.
Declaration
Swift
let minimumOutputSizeInBytes: Int -
The maximum output size in bytes.
Declaration
Swift
let maximumOutputSizeInBytes: Int -
Calculates a generic hash for a given memory region.
Precondition
precondition:
minimumOutputSizeInBytes≤outputSizeInBytes≤maximumOutputSizeInBytes- 0 ≤
inputSizeInBytes - 0 ≤
keySizeInBytes key≠nil⇒minimumKeySizeInBytes≤keySizeInBytes≤maximumKeySizeInBytes
Declaration
Swift
func hash(outputSizeInBytes: Int, input: UnsafePointer<UInt8>, inputSizeInBytes: UInt64, key: UnsafePointer<UInt8>? = nil, keySizeInBytes: Int = 0) -> BytesParameters
outputSizeInBytesThe size of the output in bytes.
inputA pointer to the memory region that should be hashed.
inputSizeInBytesThe size of
input.keyThe key that should be used for keyed hashing.
keySizeInBytesThe size of
key.Return Value
The hash.
-
Calculates a generic hash for a given memory region.
Precondition
0 ≤
inputSizeInBytesDeclaration
Swift
func hash(input: UnsafePointer<UInt8>, inputSizeInBytes: UInt64) -> BytesParameters
inputA pointer to the memory region that should be hashed.
inputSizeInBytesThe size of
input.Return Value
The hash.
View on GitHub
SodiumGenericHash Structure Reference