Generate a hash of the input value, using PHP's hash function.
- Service:
CleverAge\ProcessBundle\Transformer\String\HashTransformer - Transformer code:
hash
Any value that can be cast to string.
string: the hash, as lowercase hexits by default, or raw binary data if raw_output is true
| Code | Type | Required | Default | Description |
|---|---|---|---|---|
algo |
string |
X | Hashing algorithm (e.g. md5, sha1, sha256, crc32b), must be one of hash_algos() |
|
raw_output |
bool |
false |
If true, output raw binary data instead of lowercase hexits |
'foo'becomes'2c26b46b68ffc68ff99b453c1d30413413422d706483bfa0f98a5e886266e7ae'
# Transformer options level
hash:
algo: sha256- Compute a checksum of several fields
# Transformer mapping level
checksum:
code:
- '[sku]'
- '[price]'
transformers:
implode:
separator: '|'
hash:
algo: md5