utf8-binary
v0.2.0
Published
A fast UTF-8 encoding and decoding
Downloads
579
Readme
utf8-binary
A fast UTF-8 encoding and decoding.
Future works (not implemented yet)
- Web browsers
Installation
# npm
npm install utf8-binary
# yarn
yarn add utf8-binary
Usage
const { utf8toBin, binToUtf8 } = require('utf8-binary');
const bin = utf8toBin('\u0080'); // '\xc2\x80'
const buf = Buffer.from(bin, 'binary');
binToUtf8(buf, 0, buf.length); // '\u0080'
Tests
Run tests as follows:
npm run test
License
Copyright © 2018-present Alex Masterov <[email protected]>
utf8-binary is licensed under MIT and can be used for any personal or commercial project.