Table of Contents

Search

  1. Preface
  2. Function reference
  3. Constants
  4. Operators
  5. Dates
  6. Functions
  7. System variables
  8. Datatype reference

Function Reference

Function Reference

MD5

MD5

Calculates the checksum of the input value. The function uses Message-Digest algorithm 5 (MD5). MD5 is a one-way cryptographic hash function with a 128-bit hash value. It calculates a unique value for each input. Use MD5 to verify data integrity.

Syntax

MD5(
value
)
Argument
Required/
Optional
Description
value
Required
String or Binary datatype. Value for which you want to calculate checksum. The case of the input value affects the return value. For example, MD5(informatica) and MD5(Informatica) return different values.

Return Value

Unique 32-character string of hexadecimal digits 0-9 and a-f.
NULL if the input is a null value.

Example

You want to write changed data to a database. You can use the MD5 function to generate a unique checksum value for a row of data each time you read data from a source. When you run new sessions to read data from the same source, you can compare the previously generated checksum value against new checksum values. You can then write rows with new checksum values to the target. Those rows represent data that is changed in the source.

Tip

You can use the return value as a hash key.

1 COMMENTS

We’d like to hear from you!
Ganesh Motamarri - April 03, 2024

Hi Team,

 

Can you please explain why we need to pass string/binary data type to generate MD5.

Informatica Documentation Team - April 04, 2024

Hi Ganesh Motamarri,

We've reached out to our development team regarding your query. They confirmed that the MD5 function is supposed to work only on string and binary types. (The Java libraries for MD5 support only strings and byte arrays.) For other data types, you can use the TO_CHAR function to convert your data to a string and then use MD5.