UNPKG

ocr-tools

Version:
12 lines (10 loc) 288 B
'use strict'; const zero = '0'.repeat(10); module.exports = function byteArrayToBinary(array) { const result = []; for (const element of array) { const binary = element.toString(2); result.push(zero.substring(0, 8 - binary.length) + binary); } return result.join(''); };