Checksum

The Checksum registry offers functions to generate and verify checksums, ensuring data integrity. It supports various algorithms for reliable error detection and data validation.

circle-info

You can easily import all the functions from the checksum registry by including the following import statement in your code

import "github.com/go-sprout/sprout/registry/checksum"

sha1sum

Sha1sum calculates the SHA-1 hash of the input string and returns it as a hexadecimal encoded string.

Signature

Must version

{{ sha1sum "" }} // Output: da39a3ee5e6b4b0d3255bfef95601890afd80709
{{ sha1sum "Hello, World!" }} // Output: 0a0a9f2a6772942557ab5355d76af442f8f65e01

sha256sum

Sha256sum calculates the SHA-256 hash of the input string and returns it as a hexadecimal encoded string.

Signature

Must version

{{ sha256sum "" }} // Output: e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
{{ sha256sum "Hello, World!" }} // Output: dffd6021bb2bd5b0af676290809ec3a53191dd81c7f70a4b28688a362182986f

adler32sum

Adler32sum calculates the Adler-32 checksum of the input string and returns it as a hexadecimal encoded string.

Signature

Must version

md5sum

Md5sum calculates the MD5 hash of the input string and returns it as a hexadecimal encoded string.

Signature

Must version

Last updated