Files
data-over-audio/converters.js
2024-05-10 04:42:51 -04:00

11 lines
237 B
JavaScript

export const bitsToInt = (bits, bitLength) => {
parseInt(bits
// only grab the bits we need
.slice(0, bitLength)
// combine into string
.join('')
// Assume missing bits were zeros
.padEnd(bitLength, '0')
);
}