code: function bintooctoutput(bin){
    var len = bin.length;
    var octoutput = String();
    for(var i=0; i<len; i+=3){
      if((i > 0) && !(i%24)){octoutput = " " + octoutput;}
      var value = 0;
      if(bin[len - 1 - i - 0]){value+=1;}
      if(bin[len - 1 - i - 1]){value+=2;}
      if(bin[len - 1 - i - 2]){value+=4;}
      switch(value){
        case 0: octoutput = "0" + octoutput; break;
        case 1: octoutput = "1" + octoutput; break;
        case 2: octoutput = "2" + octoutput; break;
        case 3: octoutput = "3" + octoutput; break;
        case 4: octoutput = "4" + octoutput; break;
        case 5: octoutput = "5" + octoutput; break;
        case 6: octoutput = "6" + octoutput; break;
        case 7: octoutput = "7" + octoutput; break;
        default: break;
      }
    }
    // todo: make faster
    return octoutput;
  }
docs: Formats the given binary array to a octal output string