Random functionv0.1.0
A version 4 UUID drawn from the operating system's entropy.
pub func Random() -> Uuid ! EntropyError
Fails with why entropy was unavailable rather than producing a zero-filled UUID with the version bits set, which would be a valid-looking identifier that is entirely predictable.
Returns: a version 4 value drawn from the system's generator, or why entropy was unavailable
Related
RandomFromBytes
pub func RandomFromBytes(bytes: byte[..]) -> Uuid
A version 4 UUID built from sixteen bytes the caller supplies. For reproducing a UUID from a recorded seed, or for drawing from a generator other than the system's. The version and variant bits are set regardless of what the bytes say, so the result is always a well-formed version 4 UUID.
Parameters
| Name | Type | Description |
|---|---|---|
bytes | byte[..] | sixteen bytes to take as the value, in big-endian order |
Returns: those bytes with the version and variant fields set for version 4