node.js 的打包/解包函数 [英] pack / unpack functions for node.js
问题描述
是否有任何模块为 nodejs 提供类似于 python 的 struct 模块的打包/解包功能?我还没有找到任何专门针对 node 的,我认为 javascript 实现会明显变慢.
Are there any modules that provide pack / unpack functionality for nodejs similar to python's struct module? I haven't found any specifically for node, and I'd assume that javascript implementations would be significantly slower.
谢谢.
推荐答案
https://github.com/pgriess/node-jspack 似乎是 Python 用于打包二进制数据的 struct
API 的直接端口,但它是在 JS 中实现的.它似乎还没有为 npm 打包.
https://github.com/pgriess/node-jspack appears to be a straight-up port of Python's struct
API for packing binary data, but it's implemented in JS. It doesn't appear to be packaged for npm yet.
https://github.com/substack/node-binary 提供解包,也实现在 JS 中,如果你安装了 npm,你可以使用 npm install binary
安装它.
https://github.com/substack/node-binary provides unpacking, also implemented in JS, and you can install it with npm install binary
if you have npm installed.
这篇关于node.js 的打包/解包函数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!