(txt, spaceSeparatedOctets)
| 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() { |