CFLib.org – Common Function Library Project

ccEscape(ccnum)

Last updated September 20, 2004
Download UDF

author

Joshua Miller                                     Joshua Miller

Version: 1 | Requires: ColdFusion 5 | Library: StrLib

Description:
Escapes a credit card number, showing only the last 4 digits. The other digits are replaced with the * character.

Return Values:
Returns a string.

Example:

<cfset creditcard="4343010125259797">
<cfoutput>#ccEscape(creditcard)#</cfoutput>

Parameters:

Name Description Required
ccnum Credit card number you want to escape. Yes

Full UDF Source:

<cfscript>
/**
* Escapes a credit card number, showing only the last 4 digits. The other digits are replaced with the * character.
*
* @param ccnum      Credit card number you want to escape. (Required)
* @return Returns a string.
* @author Joshua Miller (josh@joshuasmiller.com)
* @version 1, September 20, 2004
*/

function ccEscape(ccnum){
    return "#RepeatString("*",val(Len(ccnum)-4))##Right(ccnum,4)#";
}
</cfscript>

Search CFLib.org


Latest Additions

Raymond Compton Raymond Compton added
structBlend
20 day(s) ago

Duncan Duncan added
IsZIPUK
20 day(s) ago

Todd Sharp Todd Sharp added
getTagContentAll
26 day(s) ago

Gerald Guido Gerald Guido added
ListReturnDuplicat...
1 month(s) ago

Gerald Guido Gerald Guido added
ListReturnDuplicat...
1 month(s) ago

Created by Raymond Camden / Design by Justin Johnson