Global Helpers
deobfuscateParam()
Signature
Section titled “Signature”deobfuscateParam() — returns string
Available in: controller, model, test, migrator, migration, tabledefinition
Category: Miscellaneous Functions
Description
Section titled “Description”Converts an obfuscated string back into its original value. This is typically used when IDs or other sensitive data are encoded for security purposes and need to be restored to their original form.
Parameters
Section titled “Parameters”| Name | Type | Required | Default | Description |
|---|---|---|---|---|
param | string | yes | — | The value to deobfuscate. |
Examples
Section titled “Examples”Example 1: Deobfuscate a single value
<cfscript>
// Assume "b7ab9a50" is an obfuscated ID
originalValue = deobfuscateParam("b7ab9a50");
writeOutput("Original value: #originalValue#");
</cfscript>
Converts the obfuscated string "b7ab9a50" back to its original value.
Useful for safely passing IDs in URLs or forms while preventing direct exposure of database keys.
Example 2: Deobfuscate a request parameter
<cfscript>
// Assume params.userId contains an obfuscated user ID
userId = deobfuscateParam(params.userId);
user = model("user").findByKey(userId);
writeDump(user);
</cfscript>
Safely retrieves a user using an obfuscated ID passed in a URL or form.