byteToBits
Converts a 8 bit integer number into a bit string with an optional "0b" prefix. The result is padded with leading zeroes to become 'n' chars long ('2 + n' chars long if you count the "0b" prefix).
export function byteToBits(
b: number,
n: number,
prefix: boolean
): string
Arguments
Name | Type | Description |
---|---|---|
b | number | |
n | number | |
prefix | boolean |
Return value
string