MCPcopy Index your code
hub / github.com/dcodeIO/bcrypt.js / next

Function next

index.js:987–1012  ·  view source on GitHub ↗

* Calcualtes the next round. * @returns {Array. |undefined} Resulting array if callback has been omitted, otherwise `undefined` * @inner

()

Source from the content-addressed store, hash-verified

985 * @inner
986 */
987 function next() {
988 if (progressCallback) progressCallback(i / rounds);
989 if (i < rounds) {
990 var start = Date.now();
991 for (; i < rounds; ) {
992 i = i + 1;
993 _key(b, P, S);
994 _key(salt, P, S);
995 if (Date.now() - start > MAX_EXECUTION_TIME) break;
996 }
997 } else {
998 for (i = 0; i < 64; i++)
999 for (j = 0; j < clen >> 1; j++) _encipher(cdata, j << 1, P, S);
1000 var ret = [];
1001 for (i = 0; i < clen; i++)
1002 ret.push(((cdata[i] >> 24) & 0xff) >>> 0),
1003 ret.push(((cdata[i] >> 16) & 0xff) >>> 0),
1004 ret.push(((cdata[i] >> 8) & 0xff) >>> 0),
1005 ret.push((cdata[i] & 0xff) >>> 0);
1006 if (callback) {
1007 callback(null, ret);
1008 return;
1009 } else return ret;
1010 }
1011 if (callback) nextTick(next);
1012 }
1013
1014 // Async
1015 if (typeof callback !== "undefined") {

Callers 1

_cryptFunction · 0.70

Calls 2

_keyFunction · 0.85
_encipherFunction · 0.85

Tested by

no test coverage detected