fast-is-utf8

1.0.0 • Public • Published

Fast UTF8 detector

Check utf8 using AVX2 and c++ source code from simdjson

npm install fast-is-utf8

Usage

const isUTF8 = require('fast-is-utf8');
 
const buf = Buffer.from([0xd0, 0x90]);
 
console.log(isUTF8(buf)); // => true

Benchmark

$ node benchmark.js
 
fast-is-utf8 x 2,143,027 ops/sec ±0.37% (93 runs sampled)
is-utf8 x 660,326 ops/sec ±0.32% (94 runs sampled)
Fastest is fast-is-utf8

License

MIT

Readme

Keywords

none

Package Sidebar

Install

npm i fast-is-utf8

Weekly Downloads

2

Version

1.0.0

License

MIT

Unpacked Size

106 kB

Total Files

14

Last publish

Collaborators

  • d-band