encoding/hash

Hash text with MD5, SHA-1, SHA-256, or SHA-512; returns hex and base64 digests.

Free / no pricing configured

What it does

Computes a cryptographic hash of UTF-8 text and returns both the hex and base64 digest.

Primary use cases

  • Producing a checksum or fingerprint of a string.
  • Generating cache keys or content-addressed identifiers.

Good to know

algorithm is one of md5, sha1, sha256 (default), sha512. Input is treated as UTF-8 text. Computed locally, so the digest is exact.

Parameters

textstringrequired

The text to hash (UTF-8).

algorithmstringoptional

Hash algorithm. Defaults to sha256.

encoding/hash — Faro