Skip to main content

base64_hmac

Generates a base64-encoded HMAC digest using a salt, value, and key with the specified hashing algorithm.

def base64_hmac(
salt: string,
value: string,
key: string,
algorithm: string = None
) - > string

Generates a base64-encoded HMAC digest using a salted key for secure hashing.

Parameters

NameTypeDescription
saltstringA unique salt value used to derive a specific key from the base secret key.
valuestringThe input data to be hashed by the HMAC algorithm.
keystringThe base secret key used for the HMAC operation.
algorithmstring = NoneThe hashing algorithm to use (e.g., 'sha1', 'sha256'); defaults to 'sha1' with a deprecation warning for future transition to 'sha256'.

Returns

TypeDescription
stringThe base64-encoded string representation of the HMAC digest.