Skip to main content

Hashing

You can create a hash of some text using the hash helper.
{{#hash algorithm='sha-256' encoding='hex'}}text to hash{{/hash}}
The output of the helper is a binary encoded string. The encoding used is determined by the encoding option supplied to the helper. Supported encoding values are hex and base64. The algorithm option determines the hashing algorithm that will be applied to the input text. Supported algorithm values are:
  • sha-1
  • sha-224
  • sha-256
  • sha-384
  • sha-512
  • sha3-224
  • sha3-256
  • sha3-384
  • sha3-512
  • md2
  • md5

Examples

SHA-256 hex encoding:
{{#hash algorithm='sha-256' encoding='hex'}}text to hash{{/hash}}
will output 119e3f0d28cf6a92d29399d5787f90308b6b87670d8c2386ec42cb36e293b5c4
MD5 base64 encoding:
{{#hash algorithm='md5' encoding='base64'}}text to hash{{/hash}}
will output J3A5Rbm86ssJVG0uEDrTYA==