How do I create bit array in Javascript?

后端 未结 8 715
别跟我提以往
别跟我提以往 2020-12-05 04:47

What is the best way of implementing a bit array in JavaScript?

8条回答
  •  伪装坚强ぢ
    2020-12-05 05:42

    The Stanford Javascript Crypto Library (SJCL) provides a Bit Array implementation and can convert different inputs (Hex Strings, Byte Arrays, etc.) to Bit Arrays.

    Their code is public on GitHub: bitwiseshiftleft/sjcl. So if you lookup bitArray.js, you can find their bit array implementation.

    A conversion from bytes to bits can be found here.

提交回复
热议问题