Skip to main content

mask_hash

Return the given hash, with only the first show number shown. The rest are masked with char for security reasons.

def mask_hash(
hash: string,
show: integer = 6,
char: string = "*"
) - > string

Return the given hash, with only the first show number shown. The rest are masked with char for security reasons.

Parameters

NameTypeDescription
hashstringThe original hash string or sensitive identifier to be masked
showinteger = 6The number of leading characters from the original hash to remain visible
charstring = "*"The character used to replace the hidden portion of the hash

Returns

TypeDescription
stringThe partially obscured hash string with sensitive trailing characters replaced by the mask character