How to use the rfc4648.codec function in rfc4648

To help you get started, we’ve selected a few rfc4648 examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github holochain / n3h / packages / hc-dpki / delete-me / perry.js View on Github external
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 )
    }
github holochain / n3h / packages / hc-dpki / delete-me / hid.js View on Github external
function _rawDecodeBase32 (str) {
  return Buffer.from(rfc4648.codec.parse(str.toUpperCase(), rfc4648spec, {
    loose: true
  }))
}