Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All,
I’m sharing a simple Talend routine to generate an MD5 hash from a string input.
This can be used in your Talend jobs whenever you need hashing(e.g., data anonymization, checksum validation).
Usage in Talend:
HashUtils) in your project.tMap with:package routines;
import java.security.MessageDigest;
public class HashUtils {
public static String md5(String input) {
if (input == null) return "";
try {
MessageDigest md = MessageDigest.getInstance("MD5");
byte[] digest = md.digest(input.getBytes("UTF-8"));
StringBuilder sb = new StringBuilder();
for (byte b : digest) {
sb.append(String.format("%02x", b & 0xff));
}
return sb.toString();
} catch (Exception e) {
throw new RuntimeException(e);
}
}
}
===============================
HashUtils.md5(row.inputColumn)
================================
Great post and thank you for your sharing to Qlik community!
Regards
Shicong