MCPcopy Index your code
hub / github.com/dmarman/sha256algorithm / hexToString

Function hexToString

src/classes/utils.js:19–26  ·  view source on GitHub ↗
(hex)

Source from the content-addressed store, hash-verified

17}
18
19export function hexToString(hex) {
20 let decimal = chunkString(hex, 2).map(value => parseInt(value, 16));
21
22 let valueArray = new Uint8Array(decimal);
23 const decoder = new TextDecoder('utf-8');
24
25 return decoder.decode(valueArray)
26}
27
28export function stringToHex(string) {
29 const encoder = new TextEncoder();

Callers 1

onInputBaseChangeFunction · 0.90

Calls 1

chunkStringFunction · 0.70

Tested by

no test coverage detected