MCPcopy Create free account
hub / github.com/arguiot/TheoremJS / str2bin

Method str2bin

__test__/theorem.js:1865–1873  ·  view source on GitHub ↗
(txt, spaceSeparatedOctets)

Source from the content-addressed store, hash-verified

1863 return binb2hex(core_sha256(str2binb(s), s.length * chrsz));
1864 }
1865 str2bin(txt, spaceSeparatedOctets) {
1866 function zeroPad(num) {
1867 return "00000000".slice(String(num).length) + num
1868 }
1869 return txt.replace(/[\s\S]/g, function(str) {
1870 str = zeroPad(str.charCodeAt().toString(2));
1871 return !1 == spaceSeparatedOctets ? str : str + " "
1872 })
1873 }
1874 complex(a=0, b=0) {
1875 class complex {
1876 abs() {

Callers 1

test.jsFile · 0.80

Calls 2

zeroPadFunction · 0.85
toStringMethod · 0.80

Tested by

no test coverage detected