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

Function stringToHex

src/classes/utils.js:28–38  ·  view source on GitHub ↗
(string)

Source from the content-addressed store, hash-verified

26}
27
28export function stringToHex(string) {
29 const encoder = new TextEncoder();
30 const byteArray = encoder.encode(string);
31 let result = [];
32
33 byteArray.forEach((value) => {
34 result.push(value.toString(16));
35 });
36
37 return result.join('')
38}
39
40export function binaryToHex(binary) {
41 return parseInt(binary, 2).toString(16);

Callers 1

onInputBaseChangeFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected