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);
}
