import { sha256 } from 'hash.js' import { Buffer } from 'buffer/' /** * This function return a base64 string representation of a hashed string * @param value the string to hash * @returns a base64 string representation of a hashed value */ export function hashToBase64String(value: string): string { return Buffer.from(sha256().update(value).digest('hex'), 'hex').toString('base64') }