functiongetMD5

getMD5 Function

The getMD5 function generates an MD5 hash from a given input string using Node.js’ built-in cryptoarrow-up-right module. It supports configurable output encodings for flexible use in tracking and transformation scenarios.


Purpose

Use this.getMD5 to:

  • Create a non-secure hash of a string (e.g., for deduplication, consistent keys)

  • Generate lightweight identifiers or short checksums

  • Obfuscate simple input values for non-critical use cases

⚠️ Note: MD5 is considered insecure for cryptographic purposes. Do not use it for hashing sensitive or security-critical data.


Function Definition

Property
Description

Function Name

this.getMD5

Type

function

Available In

Server-Side Variables

Returns

string (the hashed output)


Parameters

Parameter
Description
Type
Required
Example

input

The string value to hash

string

square-check

"secret"

encoding

The output encoding format ("hex", "base64", etc.)

string

square-check

"hex"


Supported Encodings

Refer to the Node.js crypto documentationarrow-up-right for supported encodings. Common options:

  • hex (recommended for readable output)

  • base64

  • latin1


Example Usage

This example returns the MD5 hash of the string "secret" encoded as a hexadecimal string.


Use Cases

  • Generate consistent hash keys for non-sensitive data

  • Shorten string representations for logging or external IDs

  • Create anonymized values when security is not a concern


Notes

  • Always specify a valid encoding (no default is assumed).

  • For secure hashing (e.g., SHA-256), use this.getHash instead.

  • Output is deterministic: same input and encoding will always return the same result.


Summary

this.getMD5 is a quick and easy way to generate an MD5 hash in JENTIS server-side variables. While not suitable for cryptographic use, it is useful for creating lightweight, repeatable hashes for general-purpose tracking logic.

Last updated

Was this helpful?