import crypto from 'crypto'
export const base64URLEncode = (str) => {
    return str.toString('base64')
        .replace(/\+/g, '-')
        .replace(/\//g, '_')
        .replace(/=/g, '');
}

export const getHashString = (obj) => {
    return base64URLEncode(crypto.createHash('sha256').update(obj).digest())
}