0.2.0 • Published 6 years ago

utf8-binary v0.2.0

Weekly downloads
1
License
MIT
Repository
-
Last release
6 years ago

utf8-binary

A fast UTF-8 encoding and decoding.

npm GitHub license Build Status Coverage Status

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 <alex.masterow@gmail.com>

utf8-binary is licensed under MIT and can be used for any personal or commercial project.