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

function getHashString(obj) {
    return base64URLEncode(crypto.createHash('sha256').update(obj).digest())
}

export {
    base64URLEncode,
    getHashString
}