MCPcopy Create free account
hub / github.com/cryptii/cryptii / binaryStringFromBytes

Method binaryStringFromBytes

src/ByteEncoder.js:64–68  ·  view source on GitHub ↗

* Returns binary string representing given bytes. * @param {Uint8Array} bytes Bytes * @return {string} Binary string

(bytes)

Source from the content-addressed store, hash-verified

62 * @return {string} Binary string
63 */
64 static binaryStringFromBytes (bytes) {
65 return Array.from(bytes)
66 .map(byte => ('0000000' + byte.toString(2)).slice(-8))
67 .join('')
68 }
69
70 /**
71 * Returns bytes from given binary string.

Callers 1

performViewMethod · 0.80

Calls 2

joinMethod · 0.80
toStringMethod · 0.80

Tested by

no test coverage detected