文件名称:compact-uint:紧凑型无符号整数
文件大小:4KB
文件格式:ZIP
更新时间:2024-05-30 17:05:31
JavaScript
紧凑型 JS中的 npm install compact-uint 用法 const cuint = require ( 'compact-uint' ) cuint . encode ( 12 ) // -> Buffer([0x0c]) cuint . encode ( 123 ) // -> Buffer([0x7b]) cuint . encode ( 1234 ) // -> Buffer([0xfc04d2]) 原料药 buf = cuint.encode(uint, [buf], [offset]) 使用紧凑的大小规范将uint编码到缓冲区中。 编码后,将encode.bytes设置为用于对该数字进行编码的字节数。 len = cuint.encodingLength(uint) 编码一个uint需要多少字节? uint = cuint.decode(buf, [offs
【文件预览】:
compact-uint-master
----.gitignore(24B)
----README.md(837B)
----.github()
--------workflows()
----LICENSE(1KB)
----package.json(609B)
----index.js(1KB)
----test.js(2KB)