UNPKG

asn1-ts

Version:

ASN.1 encoding and decoding, including BER, CER, and DER.

5 lines (4 loc) 195 B
export default function getBitFromBase128(from, bitIndex) { const byteIndex = (from.length - (Math.floor(bitIndex / 7) + 1)); return ((from[byteIndex] & (0x01 << (bitIndex % 7))) > 0); }