The numeric value (number or bigint). Numbers are converted to bigint internally.
OptionalassignedName: stringOptional human-readable name for the value
Returns the numeric value of the KnownValue.
This is the raw unsigned integer that identifies the concept.
Returns a number for backward compatibility. For values > MAX_SAFE_INTEGER,
use valueBigInt().
Returns a human-readable name for the KnownValue.
If the KnownValue has an assigned name, that name is returned. Otherwise, the string representation of the numeric value is returned.
Compares this KnownValue with another for equality. Equality is based solely on the numeric value, ignoring the name.
The KnownValue to compare with
true if the values are equal
Hash code based on the numeric value. Useful for using KnownValue in hash-based collections.
Returns the cryptographic digest of this KnownValue.
The digest is computed from the tagged CBOR encoding of the value, providing a unique content-addressable identifier.
This is used for Envelope integration where KnownValues are hashed for tree construction.
A Digest of the tagged CBOR encoding
String representation of the KnownValue.
If a name is assigned, the name is displayed. Otherwise, the numeric value is displayed.
Returns the CBOR tags associated with KnownValue.
The primary tag is TAG_KNOWN_VALUE (201).
Array containing the KnownValue tag
Returns the untagged CBOR encoding of this KnownValue.
The untagged representation is simply the unsigned integer value.
CBOR representation of the value (unsigned integer)
Alias for toCborData() to match the dcbor interface.
Creates a KnownValue from untagged CBOR (an unsigned integer). Instance method for interface compliance.
The CBOR value (must be an unsigned integer)
A new KnownValue
Creates a KnownValue from tagged CBOR (tag 201). Instance method for interface compliance.
The tagged CBOR value
A new KnownValue
StaticfromCreates a KnownValue from untagged CBOR (an unsigned integer).
The CBOR value (must be an unsigned integer)
A new KnownValue
StaticfromCreates a KnownValue from tagged CBOR (tag 201).
The tagged CBOR value
A new KnownValue
StaticfromCreates a KnownValue from binary CBOR data.
Binary CBOR data (must be a tagged KnownValue)
A new KnownValue
StaticfromCreates a KnownValue from a CBOR value, automatically detecting whether it's tagged or untagged.
The CBOR value (tagged or untagged)
A new KnownValue
Creates a new KnownValue with the given numeric value and optional name.