29 lines
705 B
JavaScript
29 lines
705 B
JavaScript
/*
|
|
* Template: Binary utility tool
|
|
* Purpose: parse and transform bytes with synthetic examples.
|
|
* Warning: Replace placeholder host APIs with verified Multi-PROG Help API calls.
|
|
*/
|
|
|
|
const SCRIPT_METADATA = {
|
|
name: "template_binary_tool",
|
|
version: "0.1.0",
|
|
purpose: "Binary processing",
|
|
author: "Repository contributor",
|
|
validation: "Synthetic test data only",
|
|
};
|
|
|
|
function toHex(buffer) {
|
|
if (!(buffer instanceof Uint8Array))
|
|
throw new TypeError("Uint8Array required");
|
|
return Array.from(buffer)
|
|
.map((b) => b.toString(16).padStart(2, "0"))
|
|
.join(" ");
|
|
}
|
|
|
|
function main() {
|
|
const sample = new Uint8Array([0xde, 0xad, 0xbe, 0xef]);
|
|
console.log(toHex(sample));
|
|
}
|
|
|
|
main();
|