index.js
function bintobinoutput(bin){
  var len = bin.length;
  var binoutput = String();
  for(var i=0; i<len; i++){
    if((i > 0) && !(i%8)){binoutput = " " + binoutput;}
    if(bin[len - 1 - i]){binoutput = "1" + binoutput;}else{binoutput = "0" + binoutput;}
  }
  // todo: make faster
  return binoutput;
}
function bintobinoutput(bin){
  var len = bin.length;
  var binoutput = String();
  for(var i=0; i<len; i++){
    if((i > 0) && !(i%8)){binoutput = " " + binoutput;}
    if(bin[len - 1 - i]){binoutput = "1" + binoutput;}else{binoutput = "0" + binoutput;}
  }
  // todo: make faster
  return binoutput;
}
function bintobinoutput ( bin ) { var len = bin . length ; var binoutput = String ( ) ; for ( var i = 0 ; i < len ; i ++ ) { if ( ( i > 0 ) && ! ( i % 8 ) ) { binoutput = " " + binoutput ; } if ( bin [ len - 1 - i ] ) { binoutput = "1" + binoutput ; } else { binoutput = "0" + binoutput ; } } // todo: make faster return binoutput ; }
Formats the given binary array to a binary output string
Formats the given binary array to a binary output string