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

Function zeroPad

src/includes/functions/cryptography/str2bin.js:2–4  ·  view source on GitHub ↗
(num)

Source from the content-addressed store, hash-verified

1str2bin(txt, spaceSeparatedOctets) {
2 function zeroPad(num) {
3 return "00000000".slice(String(num).length) + num
4 }
5 return txt.replace(/[\s\S]/g, function(str) {
6 str = zeroPad(str.charCodeAt().toString(2));
7 return !1 == spaceSeparatedOctets ? str : str + " "

Callers 2

str2bin.jsFile · 0.85
str2binMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected