Static ReadonlyDIGEST_The byte length of a Digest.
A copy of the bytes; mutating it does not touch this value.
StaticcodecTagged-CBOR codec; decode also accepts the untagged form.
StaticfromStaticfromStaticfromCompute SHA-256 digest of data (called "image" in the reference implementation).
The data to hash
StaticfromCompute SHA-256 digest from multiple data parts.
The parts are concatenated and then hashed.
Array of byte arrays to concatenate and hash
StaticfromStatichashCompute SHA-256 digest of data (legacy alias for fromImage).
Get hex string representation.
Get base64 representation.
Get the first four bytes of the digest as a hexadecimal string. Useful for short descriptions.
Validate the digest against the given image.
The image is hashed with SHA-256 and compared to this digest.
true if the digest matches the image.
Get string representation.
A Digest is its own digest provider - returns itself.
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.
StaticfromStaticvalidateValidate the given data against the digest, if any.
Returns true if the digest is undefined or if the digest matches the
image's digest. Returns false if the digest does not match.
SHA-256 cryptographic digest (32 bytes)
A
Digestrepresents the cryptographic hash of some data. In this implementation, SHA-256 is used, which produces a 32-byte hash value. Digests are used throughout the crate for data verification and as unique identifiers derived from data.CBOR Serialization
Digestimplements the CBOR tagged encoding interfaces, which means it can be serialized to and deserialized from CBOR with a specific tag (TAG_DIGEST = 40001).UR Serialization
When serialized as a Uniform Resource (UR), a
Digestis represented as a binary blob with the type "digest".Example