buffer-utf8-length:在缓冲区中对UTF-8字节序列进行计数的最快实现

时间:2024-05-19 22:55:54
【文件属性】:

文件名称:buffer-utf8-length:在缓冲区中对UTF-8字节序列进行计数的最快实现

文件大小:4KB

文件格式:ZIP

更新时间:2024-05-19 22:55:54

JavaScript

缓冲区-utf8长度 在缓冲区中对UTF-8字节序列进行计数的最快实现。 1万个字符的基准结果 string-char-by-char x 15,842 ops/sec ±1.22% (92 runs sampled) buffer-byte-by-byte x 33,463 ops/sec ±1.36% (91 runs sampled) buffer-utf8-length x 70,088 ops/sec ±2.31% (88 runs sampled) 安装 npm install buffer-utf8-length --save 用法 var utf8Length = require ( 'buffer-utf8-length' ) ; var buf = new Buffer ( 'My :rocket: String' ) ; // usually received from 3rd-p


【文件预览】:
buffer-utf8-length-master
----.gitignore(526B)
----README.md(1KB)
----LICENSE(1KB)
----package.json(761B)
----index.js(618B)
----test.js(460B)

网友评论