MCPcopy Create free account
hub / github.com/GamerHack/GamerHack.github.io / unhexlify

Function unhexlify

restore/75x/utils.js:33–42  ·  view source on GitHub ↗
(hexstr)

Source from the content-addressed store, hash-verified

31
32// Return the binary data represented by the given hexdecimal string.
33function unhexlify(hexstr) {
34 if (hexstr.length % 2 == 1)
35 throw new TypeError("Invalid hex string");
36
37 var bytes = new Uint8Array(hexstr.length / 2);
38 for (var i = 0; i < hexstr.length; i += 2)
39 bytes[i / 2] = parseInt(hexstr.substr(i, 2), 16);
40
41 return bytes;
42}
43
44function hexdump(data) {
45 if (typeof data.BYTES_PER_ELEMENT !== 'undefined')

Callers 1

Int64Function · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected