node.js的pack / unpack函数 [英] pack / unpack functions for node.js

查看:1021
本文介绍了node.js的pack / unpack函数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有任何模块为nodejs提供类似于python结构模块的打包/解包功能?我没有找到任何专门的节点,我假设javascript实现会明显变慢。



谢谢。

https://github.com/pgriess/ node-jspack 似乎是Python的 struct API的直接端口,用于打包二进制数据,但它是在JS中实现的。它似乎还没有为npm打包。



https://github.com/substack/node-binary 提供解包,也在JS中实现,您可以使用 npm install binary 安装它。你安装了npm。


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.

Thanks.

解决方案

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 provides unpacking, also implemented in JS, and you can install it with npm install binary if you have npm installed.

这篇关于node.js的pack / unpack函数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆