Timo Hocker
12a4c08b8a
update-scanner: automatic update
All checks were successful
continuous-integration/drone/push Build is passing
@sapphirecode/eslint-config: 2.1.13 ==> 2.1.15 minor @stryker-mutator/core: 3.3.0 ==> 3.3.1 minor @stryker-mutator/javascript-mutator: 3.3.0 ==> 3.3.1 minor ava: 3.9.0 ==> 3.10.1 minor eslint: 7.3.1 ==> 7.4.0 minor
@sapphirecode/encoding-helper
version: 1.0.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'); // convert any encoding to hex, default is utf-8
const b64 = encoding.to_b64(hex, 'hex'); // convert any encoding to base64, default is utf-8
const utf8 = encoding.to_utf8(hex, 'hex'); // convert any encoding to utf-8, no default
const hexn = encoding.num_to_hex(10); // convert a number to hex
const num = encoding.hex_to_num('a'); // convert hex to a number
License
MIT © Timo Hocker timo@scode.ovh
Description
Languages
JavaScript
100%