* Convert a raw string to an array of big-endian words * Characters >255 have their high-byte silently ignored.
(input)
| 187 | */ |
| 188 | |
| 189 | function rstr2binb(input) { |
| 190 | var i, l = input.length * 8, |
| 191 | output = Array(input.length >> 2), |
| 192 | lo = output.length; |
| 193 | for (i = 0; i < lo; i += 1) { |
| 194 | output[i] = 0; |
| 195 | } |
| 196 | for (i = 0; i < l; i += 8) { |
| 197 | output[i >> 5] |= (input.charCodeAt(i / 8) & 0xFF) << (24 - i % 32); |
| 198 | } |
| 199 | return output; |
| 200 | } |
| 201 | |
| 202 | /** |
| 203 | * Convert a raw string to an arbitrary string encoding |