def str2binb(str)
      bin = []
      mask = (1 << $chrsz) - 1
      # for(var i = 0; i < str.length * $chrsz; i += $chrsz)
      i = 0
      while i < str.length * $chrsz
        bin[i >> 5] ||= 0
        bin[i >> 5] |= (str[i / $chrsz] & mask) << (32 - $chrsz - i % 32)
        i += $chrsz
      end
      bin
    end
def str2binb(str)
      bin = []
      mask = (1 << $chrsz) - 1
      # for(var i = 0; i < str.length * $chrsz; i += $chrsz)
      i = 0
      while i < str.length * $chrsz
        bin[i >> 5] ||= 0
        bin[i >> 5] |= (str[i / $chrsz] & mask) << (32 - $chrsz - i % 32)
        i += $chrsz
      end
      bin
    end
Convert an 8-bit or 16-bit string to an array of big-endian words
 In 8-bit function, characters >255 have their hi-byte silently ignored.