Static ReadonlyNONCE_The byte length of a Nonce.
A copy of the bytes; mutating it does not touch this value.
StaticcodecTagged-CBOR codec; decode also accepts the untagged form.
StaticrandomA fresh random value; pass rng to make it deterministic.
StaticfromStaticfromThe data as a hexadecimal string.
Get base64 representation.
Get string representation.
The CBOR tags this type decodes from; the first one is used to encode.
Returns the untagged CBOR encoding (as a byte string).
The tagged CBOR form.
As a UR, typed by the first tag's name.
Staticfrom
A random nonce ("number used once").
A
Nonceis a cryptographic primitive consisting of a random or pseudo-random number that is used only once in a cryptographic communication. Nonces are often used in authentication protocols, encryption algorithms, and digital signatures to prevent replay attacks and ensure the uniqueness of encrypted messages.In this implementation, a
Nonceis a 12-byte random value. The size is chosen to be sufficiently large to prevent collisions while remaining efficient for storage and transmission.CBOR Serialization
Nonceimplements the CBOR tagged encoding interfaces, which means it can be serialized to and deserialized from CBOR with a specific tag (TAG_NONCE = 40014).UR Serialization
When serialized as a Uniform Resource (UR), a
Nonceis represented as a binary blob with the type "nonce".Common Uses
Example