@sapphirecode/encoding-helper
version: 1.1.x
Converting strings between different encodings
Installation
npm:
npm i --save @sapphirecode/encoding-helper
yarn:
yarn add @sapphirecode/encoding-helper
Usage
const encoding = require('@sapphirecode/encoding-helper');
const hex = encoding.to_hex('abc');
const b64 = encoding.to_b64(hex, 'hex');
const b58 = encoding.to_b58(hex, 'hex');
const utf8 = encoding.to_utf8(hex, 'hex');
const hexn = encoding.num_to_hex(10);
const num = encoding.hex_to_num('a');
supported input encodings:
- default supported by buffer:
- ascii
- base64
- binary
- hex
- latin1
- ucs-2
- utf-8
- utf16le
- additional encodings:
License
MIT © Timo Hocker timo@scode.ovh