有没有办法在JavaScript中读取二进制数据? [英] Is there a way to read binary data in JavaScript?

查看:218
本文介绍了有没有办法在JavaScript中读取二进制数据?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想二进制数据注入在JavaScript中的对象。有没有办法做到这一点?

I would like to inject binary data into an object in JavaScript. Is there a way to do this?

var binObj = new BinaryObject('101010100101011');

大意的东西。任何帮助将是巨大的。

Something to that effect. Any help would be great.

推荐答案

您可以使用parseInt函数:

You can use parseInt:

VAR斌= parseInt函数('10101010',2);

第二个参数(基数)是输入的基础。

The second argument (the radix) is the base of the input.

这篇关于有没有办法在JavaScript中读取二进制数据?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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