MCPcopy
hub / github.com/IvanMathy/Boop / rstr2binb

Function rstr2binb

Boop/Boop/scripts/lib/hashes.js:189–200  ·  view source on GitHub ↗

* Convert a raw string to an array of big-endian words * Characters >255 have their high-byte silently ignored.

(input)

Source from the content-addressed store, hash-verified

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

Callers 2

rstrFunction · 0.85
rstr_hmacFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected