Function token_digest_sha256

Source
pub fn token_digest_sha256(token_plaintext: &str, key: &str) -> Digest
Expand description

Produce a Digest (HMAC-SHA-256) from an access/refresh token plaintext using a secret key.

This function uses HMAC-SHA-256 instead of plain SHA-256 to provide better security by requiring knowledge of the secret key to compute valid digests.

ยงArguments

  • token_plaintext - The token string to hash
  • key - The secret key (pepper) to use for HMAC