Categories:

String & Binary Functions (Checksum)

# MD5_NUMBER_UPPER64¶

Calculates the 128-bit MD5 message digest, interprets it as a signed 128-bit big endian number, and returns the upper 64 bits of the number as an unsigned integer. This representation is useful for maximally efficient storage and comparison of MD5 digests.

## Syntax¶

MD5_NUMBER_UPPER64(<msg>)


## Arguments¶

msg

A string expression, the message to be hashed.

## Returns¶

A 64 bit unsigned integer that represents the upper 64 bits of the message digest.

## Usage Notes¶

Although the MD5* functions were originally developed as cryptographic functions, they are now obsolete for cryptography and should not be used for that purpose. They can be used for other purposes (for example, as “checksum” functions to detect accidental data corruption).

## Examples¶

select md5_number_upper64('Snowflake');

+---------------------------------+
| MD5_NUMBER_UPPER64('SNOWFLAKE') |
|---------------------------------|
|            17145559544104499780 |
+---------------------------------+