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

Function rstr2binl

Boop/Boop/scripts/lib/hashes.js:171–182  ·  view source on GitHub ↗

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

(input)

Source from the content-addressed store, hash-verified

169 */
170
171 function rstr2binl(input) {
172 var i, l = input.length * 8,
173 output = Array(input.length >> 2),
174 lo = output.length;
175 for (i = 0; i < lo; i += 1) {
176 output[i] = 0;
177 }
178 for (i = 0; i < l; i += 8) {
179 output[i >> 5] |= (input.charCodeAt(i / 8) & 0xFF) << (i % 32);
180 }
181 return output;
182 }
183
184 /**
185 * Convert a raw string to an array of big-endian words

Callers 2

rstrFunction · 0.85
rstr_hmacFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected