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

Function binaryToString

src/classes/utils.js:44–50  ·  view source on GitHub ↗
(binary)

Source from the content-addressed store, hash-verified

42}
43
44export function binaryToString(binary) {
45 let decimal = chunkString(binary, 8).map(value => binaryToDecimal(value));
46 let valueArray = new Uint8Array(decimal);
47 const decoder = new TextDecoder('utf-8');
48
49 return decoder.decode(valueArray)
50}
51
52export function decimalToBinary(decimal) {
53 return Number(decimal).toString(2)

Callers 1

onInputBaseChangeFunction · 0.90

Calls 2

binaryToDecimalFunction · 0.85
chunkStringFunction · 0.70

Tested by

no test coverage detected