Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function b32_encode_from_hex( hex, base32_encoding ) {
let b32 = rfc4648.codec.stringify(
Buffer.from( hex, 'hex' ), base32_encoding )
for ( var pads = 0; b32.length && b32[b32.length - pads - 1] === '='; ++pads ) {}
return b32.slice( 0, b32.length - pads )
}
function _rawDecodeBase32 (str) {
return Buffer.from(rfc4648.codec.parse(str.toUpperCase(), rfc4648spec, {
loose: true
}))
}