@ideem/zsm-client-sdk
Version:
ZSM makes 2FA easy and invisible for everyone, all the time, using advanced cryptography like MPC to establish cryptographic proof of the origin of any transaction or login attempt, while eliminating opportunities for social engineering. ZSM has no relian
18 lines (16 loc) • 1.37 kB
JavaScript
/**
* @name encodeUserIdentifier
* @description Placeholder function for encoding user identifiers (this will be used in the one-way hashing operation to obfuscate client-side userIdentifiers/customerDefinedIdentifiers
* @ before they are sent to the server, to protect user privacy). Currently, this function is defined as (and being USED as) a no-op - it simply hands back the input as-is,
* @ but this will be replaced with the actual encoding function once the hashing mechanism has been finalized and implemented.
* @param {string} userIdentifier The user identifier to be encoded (e.g., email, username, etc.)
* @returns {string} The encoded user identifier
* @throws {TypeError} If the input is not a string or is missing
* @memberof UMFAClientBase, FIDO2ClientBase
* @example const encodedId = encodeUserIdentifier("some@email.com");
*/
function encodeUserIdentifier(userIdentifier) {
if (typeof userIdentifier !== 'string') throw new TypeError(`[encodeUserIdentifier.js] :: encodeUserIdentifier :: userIdentifier is a required parameter and must be a string. Received ${userIdentifier} (type: ${typeof userIdentifier})`);
return userIdentifier;
}
export { encodeUserIdentifier };