blob: 06a1c22ffdd6f124527388fb9d672c02440a6617 [file] [edit]
import { createHash } from 'node:crypto';
/**
* hash the given string
* @param {string} str the string to hash
* @returns {string} the hash
*/
export default function hash(str) {
return createHash('sha256').update(str).digest('base64url').slice(0, 10);
}