https://github.com/serapath/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://github.com/serapath/b-buf-b
base10 base16 base2 base32 base36 base64 base8 basex binary buffer bytes decimal decode decoding deserialize encode encoding hex serialize transcode
Last synced: 11 months ago
JSON representation
base-x to bytesbuffer to base-x (x=2,8,10,16,32,36,64) https://www.npmjs.com/package/b-buf-b
- Host: GitHub
- URL: https://github.com/serapath/b-buf-b
- Owner: serapath
- License: mit
- Created: 2020-06-24T00:28:30.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2020-06-24T00:46:07.000Z (over 5 years ago)
- Last Synced: 2024-04-25T11:20:20.490Z (almost 2 years ago)
- Topics: base10, base16, base2, base32, base36, base64, base8, basex, binary, buffer, bytes, decimal, decode, decoding, deserialize, encode, encoding, hex, serialize, transcode
- Language: JavaScript
- Homepage: https://serapath.github.io/b-buf-b/
- Size: 2.93 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
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`
```js
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)
```