Salt
public class Salt
A class to wrap around Salts in argon2. allowing cryptographically secure generation of salts as well as utilization of premade salts
-
The byte-array that the salt class wraps around
Declaration
Swift
public let bytes: Data
-
Initializes a new
Salt
object with the provided byte arrayDeclaration
Swift
public init(bytes: Data)
Parameters
bytes
The byte array to pass to the Salt object
Return Value
A Salt object containing the byte array
-
Initialized a new
Salt
object with a cryptographically secure random byte arrayDeclaration
Swift
public static func newSalt(length: Int = 16) -> Salt
Parameters
length
An optional parameter to set the length the salt should be (set to 16 bytes by default)
Return Value
A
Salt
object containing a random byte array of the specified length