Initializerswift-crypto 3.12.2Crypto
init(data:)
Creates a nonce from the given data.
- iOS
- 13+
- macOS
- 10.15+
- tvOS
- 13+
- watchOS
- 6+
init<D>(data: D) throws where D : DataProtocol
Parameters
- data
A 12-byte data representation of the nonce. The initializer throws an error if the data has a length other than 12 bytes.
Unless your use case calls for a nonce with a specific value, use the init
method to instead create a random nonce.