Package Exports
- b-buf-b
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (b-buf-b) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
b-buf-b
base-x to bytesbuffer to base-x (x=2,8,10,16,32,36,64)
https://www.npmjs.com/package/b-buf-b
https://serapath.github.io/b-buf-b/
use
npm install b-buf-b
const {
base2string_to_bytebuffer,
bytebuffer_to_base2string,
base8string_to_bytebuffer,
bytebuffer_to_base8string,
base10input_to_bytebuffer,
bytebuffer_to_base10bigint,
base16string_to_bytebuffer,
bytebuffer_to_base16string,
base32string_to_bytebuffer,
bytebuffer_to_base32string,
base36string_to_bytebuffer,
bytebuffer_to_base36string,
base64string_to_bytebuffer,
bytebuffer_to_base64string,
} = require('b-buf-b')
const randombytes = require('randombytes')
const ee = randombytes(7)
// BASE 2
const $b2 = bytebuffer_to_base2string(ee)
const $buf2 = base2string_to_bytebuffer($b2)
// BASE 8
const $b8 = bytebuffer_to_base8string(ee)
const $buf8 = base8string_to_bytebuffer($b8)
// BASE 10 (bigint)
const $b10 = bytebuffer_to_base10bigint(ee)
const $buf10 = base10input_to_bytebuffer($b10)
// BASE 16
const $b16 = bytebuffer_to_base16string(ee)
const $buf16 = base16string_to_bytebuffer($b16)
// BASE 32
const $b32 = bytebuffer_to_base32string(ee)
const $buf32 = base32string_to_bytebuffer($b32)
// BASE 36
const $b36 = bytebuffer_to_base36string(ee)
const $buf36 = base36string_to_bytebuffer($b36)
// BASE 64
const $b64 = bytebuffer_to_base64string(ee)
const $buf64 = base64string_to_bytebuffer($b64)