Instance Methodswift-crypto 3.8.0Crypto
withUnsafeBytes(_:)
Calls the given closure with a pointer to the underlying bytes of the array’s contiguous storage.
Nonces.swift:133func withUnsafeBytes<R>(_ body: (UnsafeRawBufferPointer) throws -> R) rethrows -> R
Parameters
- body
A closure with an
UnsafeRawBufferPointer
parameter that points to the contiguous storage for the array. The system creates the storage if it doesn’t exist. If body has a return value, that value is also used as the return value for thewithUnsafeBytes(_:)
method. The argument is valid only for the duration of the closure’s execution.
Returns
The return value, if any, of the body closure parameter.
Other members in extension
Type members
init(
) Creates a new random nonce.
init<D>(data: D
) throws Creates a nonce from the given data.
Instance members
func makeIterator(
) -> Array<UInt8>.Iterator Returns an iterator over the elements of the nonce.