Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FromObjects ¶
func FromObjects(obj ...any) digest.Digest
FromObjects returns a digest for the specified objects. SHA-256 is used as the algorithm. The objects are serialized to JSON before the digest is calculated. If an error occurs during serialization, an empty digest is returned.
func Short ¶
Short returns a short string representation of the digest. If the full digest is shorter than the specified length, the full digest is returned. This is useful for displaying digests in user facing outputs. As example, for a sha:256 digest, the full digest is 64 characters long, but a short digest can be 10 characters long. This will have a total of 16^10 or 2^40 possible values, which is still a large enough space to avoid collisions.
Types ¶
This section is empty.