A copy of the bytes; mutating it does not touch this value.
Number of bytes.
The optional metadata as one object.
The label, empty when none was given; set it to a string (InvalidData otherwise).
Return the note of the seed.
returns empty string if not set.
Setting it requires a string (InvalidData otherwise).
Return the creation date of the seed.
Setting it requires a valid Date or undefined (InvalidData otherwise).
The creation date as decoded, with the precision the wire carried.
StaticcodecTagged-CBOR codec; decode also accepts the untagged form.
StaticrandomA random seed of length bytes (16 by default), with optional metadata;
pass rng to make it deterministic.
StaticfromCreate a Seed from raw bytes with optional metadata.
Note: The input data is copied to prevent external mutation of the seed's internal state.
Seed bytes (must be >= 16 bytes)
Optionalmetadata: SeedMetadata
Optional metadata object
StaticfromCreate a Seed from hex string with optional metadata.
Hex string representing seed bytes
Optionalmetadata: SeedMetadata
Optional metadata object
Get hex string representation.
Get base64 representation.
Get string representation.
Returns unique data from which cryptographic keys can be derived.
This implementation returns a copy of the seed data, which can be used as entropy for deriving private keys in various cryptographic schemes.
A Uint8Array containing the seed data
The CBOR tags this type decodes from; the first one is used to encode.
Returns the untagged CBOR encoding (as a map). Map keys:
The tagged CBOR form.
As a UR, typed by the first tag's name.
Staticfrom
Cryptographic seed with optional metadata (minimum 16 bytes)
A
Seedis a source of entropy used to generate cryptographic keys in a deterministic manner. Unlike randomly generated keys, seed-derived keys can be recreated if you have the original seed, making them useful for backup and recovery scenarios.This implementation of
Seedincludes the random seed data as well as optional metadata:The minimum seed length is 16 bytes to ensure sufficient security and entropy.
CBOR Serialization
Seedimplements the CBOR tagged encoding interfaces, which means it can be serialized to and deserialized from CBOR with specific tags. The tags used areTAG_SEED(40300) and the olderTAG_SEED_V1(300) for backward compatibility.When serialized to CBOR, a
Seedis represented as a map with the following keys:UR Serialization
When serialized as a Uniform Resource (UR), a
Seedis represented with the type "seed".