Skip to main content

Introduction

The hash_md5 function returns the MD5 hash of a scalar value as a 32-character hexadecimal string. Use it to anonymize personally identifiable information while preserving joinability, detect duplicate records across datasets, or generate consistent bucket keys for grouping. MD5 produces a 128-bit digest that’s fast to compute. It isn’t suitable for cryptographic security, but is appropriate for data deduplication, checksumming, and non-security anonymization tasks. For security-sensitive use cases, use hash_sha256 or hash_sha512 instead.

For users of other query languages

If you come from other query languages, this section explains how to adjust your existing queries to achieve the same results in APL.
Splunk provides the md5(X) function that returns a 32-character hex string. APL’s hash_md5 works the same way.
ANSI SQL has no standard MD5 function, but most databases provide one: MySQL’s MD5(), PostgreSQL’s md5(). APL’s hash_md5 returns the same 32-character lowercase hex digest.

Usage

Syntax

Parameters

Returns

The MD5 hash of source as a 32-character lowercase hexadecimal string.

Use case examples

Anonymize user IDs before counting requests per user to protect PII in shared dashboards.Query
Run in PlaygroundOutputThe query replaces raw user IDs with MD5 hashes before aggregating, so the busiest users are visible without exposing their original identifiers.
  • hash_sha1: Returns a 40-character SHA-1 hex digest. Use hash_sha1 when you need a larger digest than MD5 but legacy compatibility matters.
  • hash_sha256: Returns a 64-character SHA-256 hex digest. Use hash_sha256 for security-sensitive hashing.
  • hash_sha512: Returns a 128-character SHA-512 hex digest for maximum hash strength.
  • hash: Returns a signed 64-bit integer hash. Use hash when you need a compact numeric key rather than a hex string.