import { Encoding, createHash } from 'crypto'; export const generateHash = ( input: string, encoding: Encoding = 'utf8', ): string => { const hash = createHash('sha256'); hash.update(process.env.SALT!); hash.update(input, encoding); return hash .digest() .toString('base64') .slice(0) .replaceAll('+', '-') .replaceAll('/', '_'); };