To support running a hash across multiple values, the Append and Prepend
filters were also added. They can be used to build up a string from
variables or fixed text.
They also provide a convenient way to send a hard-coded value to a
filter. E.g.
#{ | Append "Hello World" | Md5 }
Common hash functions have been added:
Md5
Sha1
Sha256
Sha384
Sha512
Each of these take 0-2 parameters.
With no options, the filter will output the hex digest of the
resulting hash.
With an integer greater than zero, truncates the hash to the specified
number of bytes. The total characters will be twice this number as
each byte in the hash is represented by two characters in the hex
representation.
With an encoding of either 'utf8', 'utf-8', 'unicode' or 'base64'. For
'utf8' and 'unicode' the string will be encoded in the applicable
encoding before calculating the hash. For 'base64', the string is
treated as a base64 encoded string and the hash is made of the
underlying binary data.
With two parameters, both the size in bytes and encoding can be
specified. These can be specified in any order.
To support running a hash across multiple values, the Append and Prepend filters were also added. They can be used to build up a string from variables or fixed text.
They also provide a convenient way to send a hard-coded value to a filter. E.g.
Common hash functions have been added:
Each of these take 0-2 parameters.