UNPKG

asn1-ts

Version:

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

4 lines (3 loc) 149 B
export default function getBit(from, bitIndex) { return ((from[from.length - (Math.floor(bitIndex / 8) + 1)] & (0x01 << (bitIndex % 8))) > 0); }