This repository has been archived on 2024-11-07. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
Dawn-GB/scripts/util.js
2022-01-04 21:36:37 -08:00

21 lines
381 B
JavaScript

const arrayToString = arr => {
const b = arr.map(n => {
return '0x' + (n.toString(16).padStart(2, '0').toUpperCase());
});
let str = '';
for(let i = 0; i < b.length; i += 16) {
str += ' ';
for(let x = i; x < Math.min(i+16, b.length); x++) {
str += b[x];
str += ',';
}
str += '\n';
}
return str;
}
module.exports = {
arrayToString
}