Embulk filter plugin to convert an input to a hash value.
- Plugin type: filter
- columns: Columns to hash (array, required)
- name: Name of input column (string, required)
- algorithm: Hash algorithm. See also (string, default:
"SHA-256"
) - secret_key: Secret key for HMAC hashing. (string, required when specifying HMAC algorithm)
- new_name: New column name if you want to rename the column (string, default:
null
)
filters:
- type: hash
columns:
- { name: username }
- { name: email, algorithm: SHA-512, new_name: hashed_email }
- { name: phone_number, algorithm: HmacSHA256, secret_key: passw0rd }
You can choose either of MessageDigest algorithm or HMAC algorithm. If you want to know all algorithms that your platform supports, run the following snippet.
for (String algorithm : java.security.Security.getAlgorithms("MessageDigest")) {
System.out.println(algorithm);
}
for (String algorithm : java.security.Security.getAlgorithms("Mac")) {
System.out.println(algorithm);
}
$ ./gradlew gem # -t to watch change of files and rebuild continuously