@stacksjs/security 0.59.10 → 0.61.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +53 -1843
- package/package.json +1 -2
- package/src/crypt.ts +3 -5
- package/src/hash.ts +46 -25
- package/src/key.ts +1 -1
- package/dist/crypt.d.ts +0 -3
- package/dist/hash.d.ts +0 -9
- package/dist/index.d.ts +0 -3
- package/dist/key.d.ts +0 -1
package/dist/index.js
CHANGED
|
@@ -307,21 +307,6 @@ var require_core = __commonJS((exports, module) => {
|
|
|
307
307
|
});
|
|
308
308
|
});
|
|
309
309
|
|
|
310
|
-
// ../../../../node_modules/crypto-js/enc-utf8.js
|
|
311
|
-
var require_enc_utf8 = __commonJS((exports, module) => {
|
|
312
|
-
(function(root, factory) {
|
|
313
|
-
if (typeof exports === "object") {
|
|
314
|
-
module.exports = exports = factory(require_core());
|
|
315
|
-
} else if (typeof define === "function" && define.amd) {
|
|
316
|
-
define(["./core"], factory);
|
|
317
|
-
} else {
|
|
318
|
-
factory(root.CryptoJS);
|
|
319
|
-
}
|
|
320
|
-
})(exports, function(CryptoJS) {
|
|
321
|
-
return CryptoJS.enc.Utf8;
|
|
322
|
-
});
|
|
323
|
-
});
|
|
324
|
-
|
|
325
310
|
// ../../../../node_modules/crypto-js/enc-base64.js
|
|
326
311
|
var require_enc_base64 = __commonJS((exports, module) => {
|
|
327
312
|
(function(root, factory) {
|
|
@@ -402,6 +387,21 @@ var require_enc_base64 = __commonJS((exports, module) => {
|
|
|
402
387
|
});
|
|
403
388
|
});
|
|
404
389
|
|
|
390
|
+
// ../../../../node_modules/crypto-js/enc-utf8.js
|
|
391
|
+
var require_enc_utf8 = __commonJS((exports, module) => {
|
|
392
|
+
(function(root, factory) {
|
|
393
|
+
if (typeof exports === "object") {
|
|
394
|
+
module.exports = exports = factory(require_core());
|
|
395
|
+
} else if (typeof define === "function" && define.amd) {
|
|
396
|
+
define(["./core"], factory);
|
|
397
|
+
} else {
|
|
398
|
+
factory(root.CryptoJS);
|
|
399
|
+
}
|
|
400
|
+
})(exports, function(CryptoJS) {
|
|
401
|
+
return CryptoJS.enc.Utf8;
|
|
402
|
+
});
|
|
403
|
+
});
|
|
404
|
+
|
|
405
405
|
// ../../../../node_modules/crypto-js/md5.js
|
|
406
406
|
var require_md5 = __commonJS((exports, module) => {
|
|
407
407
|
(function(root, factory) {
|
|
@@ -1239,1819 +1239,9 @@ var require_aes = __commonJS((exports, module) => {
|
|
|
1239
1239
|
});
|
|
1240
1240
|
});
|
|
1241
1241
|
|
|
1242
|
-
// ../../../../node_modules/bcryptjs/dist/bcrypt.js
|
|
1243
|
-
var require_bcrypt = __commonJS((exports, module) => {
|
|
1244
|
-
(function(global2, factory) {
|
|
1245
|
-
if (typeof define === "function" && define["amd"])
|
|
1246
|
-
define([], factory);
|
|
1247
|
-
else if (typeof import.meta.require === "function" && typeof module === "object" && module && exports)
|
|
1248
|
-
module["exports"] = factory();
|
|
1249
|
-
else
|
|
1250
|
-
(global2["dcodeIO"] = global2["dcodeIO"] || {})["bcrypt"] = factory();
|
|
1251
|
-
})(exports, function() {
|
|
1252
|
-
var bcrypt = {};
|
|
1253
|
-
var randomFallback = null;
|
|
1254
|
-
function random(len) {
|
|
1255
|
-
if (typeof module !== "undefined" && module && module["exports"])
|
|
1256
|
-
try {
|
|
1257
|
-
return import.meta.require("crypto")["randomBytes"](len);
|
|
1258
|
-
} catch (e) {
|
|
1259
|
-
}
|
|
1260
|
-
try {
|
|
1261
|
-
var a;
|
|
1262
|
-
(self["crypto"] || self["msCrypto"])["getRandomValues"](a = new Uint32Array(len));
|
|
1263
|
-
return Array.prototype.slice.call(a);
|
|
1264
|
-
} catch (e) {
|
|
1265
|
-
}
|
|
1266
|
-
if (!randomFallback)
|
|
1267
|
-
throw Error("Neither WebCryptoAPI nor a crypto module is available. Use bcrypt.setRandomFallback to set an alternative");
|
|
1268
|
-
return randomFallback(len);
|
|
1269
|
-
}
|
|
1270
|
-
var randomAvailable = false;
|
|
1271
|
-
try {
|
|
1272
|
-
random(1);
|
|
1273
|
-
randomAvailable = true;
|
|
1274
|
-
} catch (e) {
|
|
1275
|
-
}
|
|
1276
|
-
randomFallback = null;
|
|
1277
|
-
bcrypt.setRandomFallback = function(random2) {
|
|
1278
|
-
randomFallback = random2;
|
|
1279
|
-
};
|
|
1280
|
-
bcrypt.genSaltSync = function(rounds, seed_length) {
|
|
1281
|
-
rounds = rounds || GENSALT_DEFAULT_LOG2_ROUNDS;
|
|
1282
|
-
if (typeof rounds !== "number")
|
|
1283
|
-
throw Error("Illegal arguments: " + typeof rounds + ", " + typeof seed_length);
|
|
1284
|
-
if (rounds < 4)
|
|
1285
|
-
rounds = 4;
|
|
1286
|
-
else if (rounds > 31)
|
|
1287
|
-
rounds = 31;
|
|
1288
|
-
var salt = [];
|
|
1289
|
-
salt.push("$2a$");
|
|
1290
|
-
if (rounds < 10)
|
|
1291
|
-
salt.push("0");
|
|
1292
|
-
salt.push(rounds.toString());
|
|
1293
|
-
salt.push("$");
|
|
1294
|
-
salt.push(base64_encode(random(BCRYPT_SALT_LEN), BCRYPT_SALT_LEN));
|
|
1295
|
-
return salt.join("");
|
|
1296
|
-
};
|
|
1297
|
-
bcrypt.genSalt = function(rounds, seed_length, callback) {
|
|
1298
|
-
if (typeof seed_length === "function")
|
|
1299
|
-
callback = seed_length, seed_length = undefined;
|
|
1300
|
-
if (typeof rounds === "function")
|
|
1301
|
-
callback = rounds, rounds = undefined;
|
|
1302
|
-
if (typeof rounds === "undefined")
|
|
1303
|
-
rounds = GENSALT_DEFAULT_LOG2_ROUNDS;
|
|
1304
|
-
else if (typeof rounds !== "number")
|
|
1305
|
-
throw Error("illegal arguments: " + typeof rounds);
|
|
1306
|
-
function _async(callback2) {
|
|
1307
|
-
nextTick(function() {
|
|
1308
|
-
try {
|
|
1309
|
-
callback2(null, bcrypt.genSaltSync(rounds));
|
|
1310
|
-
} catch (err) {
|
|
1311
|
-
callback2(err);
|
|
1312
|
-
}
|
|
1313
|
-
});
|
|
1314
|
-
}
|
|
1315
|
-
if (callback) {
|
|
1316
|
-
if (typeof callback !== "function")
|
|
1317
|
-
throw Error("Illegal callback: " + typeof callback);
|
|
1318
|
-
_async(callback);
|
|
1319
|
-
} else
|
|
1320
|
-
return new Promise(function(resolve, reject) {
|
|
1321
|
-
_async(function(err, res) {
|
|
1322
|
-
if (err) {
|
|
1323
|
-
reject(err);
|
|
1324
|
-
return;
|
|
1325
|
-
}
|
|
1326
|
-
resolve(res);
|
|
1327
|
-
});
|
|
1328
|
-
});
|
|
1329
|
-
};
|
|
1330
|
-
bcrypt.hashSync = function(s, salt) {
|
|
1331
|
-
if (typeof salt === "undefined")
|
|
1332
|
-
salt = GENSALT_DEFAULT_LOG2_ROUNDS;
|
|
1333
|
-
if (typeof salt === "number")
|
|
1334
|
-
salt = bcrypt.genSaltSync(salt);
|
|
1335
|
-
if (typeof s !== "string" || typeof salt !== "string")
|
|
1336
|
-
throw Error("Illegal arguments: " + typeof s + ", " + typeof salt);
|
|
1337
|
-
return _hash(s, salt);
|
|
1338
|
-
};
|
|
1339
|
-
bcrypt.hash = function(s, salt, callback, progressCallback) {
|
|
1340
|
-
function _async(callback2) {
|
|
1341
|
-
if (typeof s === "string" && typeof salt === "number")
|
|
1342
|
-
bcrypt.genSalt(salt, function(err, salt2) {
|
|
1343
|
-
_hash(s, salt2, callback2, progressCallback);
|
|
1344
|
-
});
|
|
1345
|
-
else if (typeof s === "string" && typeof salt === "string")
|
|
1346
|
-
_hash(s, salt, callback2, progressCallback);
|
|
1347
|
-
else
|
|
1348
|
-
nextTick(callback2.bind(this, Error("Illegal arguments: " + typeof s + ", " + typeof salt)));
|
|
1349
|
-
}
|
|
1350
|
-
if (callback) {
|
|
1351
|
-
if (typeof callback !== "function")
|
|
1352
|
-
throw Error("Illegal callback: " + typeof callback);
|
|
1353
|
-
_async(callback);
|
|
1354
|
-
} else
|
|
1355
|
-
return new Promise(function(resolve, reject) {
|
|
1356
|
-
_async(function(err, res) {
|
|
1357
|
-
if (err) {
|
|
1358
|
-
reject(err);
|
|
1359
|
-
return;
|
|
1360
|
-
}
|
|
1361
|
-
resolve(res);
|
|
1362
|
-
});
|
|
1363
|
-
});
|
|
1364
|
-
};
|
|
1365
|
-
function safeStringCompare(known, unknown) {
|
|
1366
|
-
var right = 0, wrong = 0;
|
|
1367
|
-
for (var i = 0, k = known.length;i < k; ++i) {
|
|
1368
|
-
if (known.charCodeAt(i) === unknown.charCodeAt(i))
|
|
1369
|
-
++right;
|
|
1370
|
-
else
|
|
1371
|
-
++wrong;
|
|
1372
|
-
}
|
|
1373
|
-
if (right < 0)
|
|
1374
|
-
return false;
|
|
1375
|
-
return wrong === 0;
|
|
1376
|
-
}
|
|
1377
|
-
bcrypt.compareSync = function(s, hash) {
|
|
1378
|
-
if (typeof s !== "string" || typeof hash !== "string")
|
|
1379
|
-
throw Error("Illegal arguments: " + typeof s + ", " + typeof hash);
|
|
1380
|
-
if (hash.length !== 60)
|
|
1381
|
-
return false;
|
|
1382
|
-
return safeStringCompare(bcrypt.hashSync(s, hash.substr(0, hash.length - 31)), hash);
|
|
1383
|
-
};
|
|
1384
|
-
bcrypt.compare = function(s, hash, callback, progressCallback) {
|
|
1385
|
-
function _async(callback2) {
|
|
1386
|
-
if (typeof s !== "string" || typeof hash !== "string") {
|
|
1387
|
-
nextTick(callback2.bind(this, Error("Illegal arguments: " + typeof s + ", " + typeof hash)));
|
|
1388
|
-
return;
|
|
1389
|
-
}
|
|
1390
|
-
if (hash.length !== 60) {
|
|
1391
|
-
nextTick(callback2.bind(this, null, false));
|
|
1392
|
-
return;
|
|
1393
|
-
}
|
|
1394
|
-
bcrypt.hash(s, hash.substr(0, 29), function(err, comp) {
|
|
1395
|
-
if (err)
|
|
1396
|
-
callback2(err);
|
|
1397
|
-
else
|
|
1398
|
-
callback2(null, safeStringCompare(comp, hash));
|
|
1399
|
-
}, progressCallback);
|
|
1400
|
-
}
|
|
1401
|
-
if (callback) {
|
|
1402
|
-
if (typeof callback !== "function")
|
|
1403
|
-
throw Error("Illegal callback: " + typeof callback);
|
|
1404
|
-
_async(callback);
|
|
1405
|
-
} else
|
|
1406
|
-
return new Promise(function(resolve, reject) {
|
|
1407
|
-
_async(function(err, res) {
|
|
1408
|
-
if (err) {
|
|
1409
|
-
reject(err);
|
|
1410
|
-
return;
|
|
1411
|
-
}
|
|
1412
|
-
resolve(res);
|
|
1413
|
-
});
|
|
1414
|
-
});
|
|
1415
|
-
};
|
|
1416
|
-
bcrypt.getRounds = function(hash) {
|
|
1417
|
-
if (typeof hash !== "string")
|
|
1418
|
-
throw Error("Illegal arguments: " + typeof hash);
|
|
1419
|
-
return parseInt(hash.split("$")[2], 10);
|
|
1420
|
-
};
|
|
1421
|
-
bcrypt.getSalt = function(hash) {
|
|
1422
|
-
if (typeof hash !== "string")
|
|
1423
|
-
throw Error("Illegal arguments: " + typeof hash);
|
|
1424
|
-
if (hash.length !== 60)
|
|
1425
|
-
throw Error("Illegal hash length: " + hash.length + " != 60");
|
|
1426
|
-
return hash.substring(0, 29);
|
|
1427
|
-
};
|
|
1428
|
-
var nextTick = typeof process !== "undefined" && process && typeof process.nextTick === "function" ? typeof setImmediate === "function" ? setImmediate : process.nextTick : setTimeout;
|
|
1429
|
-
function stringToBytes(str) {
|
|
1430
|
-
var out = [], i = 0;
|
|
1431
|
-
utfx.encodeUTF16toUTF8(function() {
|
|
1432
|
-
if (i >= str.length)
|
|
1433
|
-
return null;
|
|
1434
|
-
return str.charCodeAt(i++);
|
|
1435
|
-
}, function(b) {
|
|
1436
|
-
out.push(b);
|
|
1437
|
-
});
|
|
1438
|
-
return out;
|
|
1439
|
-
}
|
|
1440
|
-
var BASE64_CODE = "./ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".split("");
|
|
1441
|
-
var BASE64_INDEX = [
|
|
1442
|
-
-1,
|
|
1443
|
-
-1,
|
|
1444
|
-
-1,
|
|
1445
|
-
-1,
|
|
1446
|
-
-1,
|
|
1447
|
-
-1,
|
|
1448
|
-
-1,
|
|
1449
|
-
-1,
|
|
1450
|
-
-1,
|
|
1451
|
-
-1,
|
|
1452
|
-
-1,
|
|
1453
|
-
-1,
|
|
1454
|
-
-1,
|
|
1455
|
-
-1,
|
|
1456
|
-
-1,
|
|
1457
|
-
-1,
|
|
1458
|
-
-1,
|
|
1459
|
-
-1,
|
|
1460
|
-
-1,
|
|
1461
|
-
-1,
|
|
1462
|
-
-1,
|
|
1463
|
-
-1,
|
|
1464
|
-
-1,
|
|
1465
|
-
-1,
|
|
1466
|
-
-1,
|
|
1467
|
-
-1,
|
|
1468
|
-
-1,
|
|
1469
|
-
-1,
|
|
1470
|
-
-1,
|
|
1471
|
-
-1,
|
|
1472
|
-
-1,
|
|
1473
|
-
-1,
|
|
1474
|
-
-1,
|
|
1475
|
-
-1,
|
|
1476
|
-
-1,
|
|
1477
|
-
-1,
|
|
1478
|
-
-1,
|
|
1479
|
-
-1,
|
|
1480
|
-
-1,
|
|
1481
|
-
-1,
|
|
1482
|
-
-1,
|
|
1483
|
-
-1,
|
|
1484
|
-
-1,
|
|
1485
|
-
-1,
|
|
1486
|
-
-1,
|
|
1487
|
-
-1,
|
|
1488
|
-
0,
|
|
1489
|
-
1,
|
|
1490
|
-
54,
|
|
1491
|
-
55,
|
|
1492
|
-
56,
|
|
1493
|
-
57,
|
|
1494
|
-
58,
|
|
1495
|
-
59,
|
|
1496
|
-
60,
|
|
1497
|
-
61,
|
|
1498
|
-
62,
|
|
1499
|
-
63,
|
|
1500
|
-
-1,
|
|
1501
|
-
-1,
|
|
1502
|
-
-1,
|
|
1503
|
-
-1,
|
|
1504
|
-
-1,
|
|
1505
|
-
-1,
|
|
1506
|
-
-1,
|
|
1507
|
-
2,
|
|
1508
|
-
3,
|
|
1509
|
-
4,
|
|
1510
|
-
5,
|
|
1511
|
-
6,
|
|
1512
|
-
7,
|
|
1513
|
-
8,
|
|
1514
|
-
9,
|
|
1515
|
-
10,
|
|
1516
|
-
11,
|
|
1517
|
-
12,
|
|
1518
|
-
13,
|
|
1519
|
-
14,
|
|
1520
|
-
15,
|
|
1521
|
-
16,
|
|
1522
|
-
17,
|
|
1523
|
-
18,
|
|
1524
|
-
19,
|
|
1525
|
-
20,
|
|
1526
|
-
21,
|
|
1527
|
-
22,
|
|
1528
|
-
23,
|
|
1529
|
-
24,
|
|
1530
|
-
25,
|
|
1531
|
-
26,
|
|
1532
|
-
27,
|
|
1533
|
-
-1,
|
|
1534
|
-
-1,
|
|
1535
|
-
-1,
|
|
1536
|
-
-1,
|
|
1537
|
-
-1,
|
|
1538
|
-
-1,
|
|
1539
|
-
28,
|
|
1540
|
-
29,
|
|
1541
|
-
30,
|
|
1542
|
-
31,
|
|
1543
|
-
32,
|
|
1544
|
-
33,
|
|
1545
|
-
34,
|
|
1546
|
-
35,
|
|
1547
|
-
36,
|
|
1548
|
-
37,
|
|
1549
|
-
38,
|
|
1550
|
-
39,
|
|
1551
|
-
40,
|
|
1552
|
-
41,
|
|
1553
|
-
42,
|
|
1554
|
-
43,
|
|
1555
|
-
44,
|
|
1556
|
-
45,
|
|
1557
|
-
46,
|
|
1558
|
-
47,
|
|
1559
|
-
48,
|
|
1560
|
-
49,
|
|
1561
|
-
50,
|
|
1562
|
-
51,
|
|
1563
|
-
52,
|
|
1564
|
-
53,
|
|
1565
|
-
-1,
|
|
1566
|
-
-1,
|
|
1567
|
-
-1,
|
|
1568
|
-
-1,
|
|
1569
|
-
-1
|
|
1570
|
-
];
|
|
1571
|
-
var stringFromCharCode = String.fromCharCode;
|
|
1572
|
-
function base64_encode(b, len) {
|
|
1573
|
-
var off = 0, rs = [], c1, c2;
|
|
1574
|
-
if (len <= 0 || len > b.length)
|
|
1575
|
-
throw Error("Illegal len: " + len);
|
|
1576
|
-
while (off < len) {
|
|
1577
|
-
c1 = b[off++] & 255;
|
|
1578
|
-
rs.push(BASE64_CODE[c1 >> 2 & 63]);
|
|
1579
|
-
c1 = (c1 & 3) << 4;
|
|
1580
|
-
if (off >= len) {
|
|
1581
|
-
rs.push(BASE64_CODE[c1 & 63]);
|
|
1582
|
-
break;
|
|
1583
|
-
}
|
|
1584
|
-
c2 = b[off++] & 255;
|
|
1585
|
-
c1 |= c2 >> 4 & 15;
|
|
1586
|
-
rs.push(BASE64_CODE[c1 & 63]);
|
|
1587
|
-
c1 = (c2 & 15) << 2;
|
|
1588
|
-
if (off >= len) {
|
|
1589
|
-
rs.push(BASE64_CODE[c1 & 63]);
|
|
1590
|
-
break;
|
|
1591
|
-
}
|
|
1592
|
-
c2 = b[off++] & 255;
|
|
1593
|
-
c1 |= c2 >> 6 & 3;
|
|
1594
|
-
rs.push(BASE64_CODE[c1 & 63]);
|
|
1595
|
-
rs.push(BASE64_CODE[c2 & 63]);
|
|
1596
|
-
}
|
|
1597
|
-
return rs.join("");
|
|
1598
|
-
}
|
|
1599
|
-
function base64_decode(s, len) {
|
|
1600
|
-
var off = 0, slen = s.length, olen = 0, rs = [], c1, c2, c3, c4, o, code;
|
|
1601
|
-
if (len <= 0)
|
|
1602
|
-
throw Error("Illegal len: " + len);
|
|
1603
|
-
while (off < slen - 1 && olen < len) {
|
|
1604
|
-
code = s.charCodeAt(off++);
|
|
1605
|
-
c1 = code < BASE64_INDEX.length ? BASE64_INDEX[code] : -1;
|
|
1606
|
-
code = s.charCodeAt(off++);
|
|
1607
|
-
c2 = code < BASE64_INDEX.length ? BASE64_INDEX[code] : -1;
|
|
1608
|
-
if (c1 == -1 || c2 == -1)
|
|
1609
|
-
break;
|
|
1610
|
-
o = c1 << 2 >>> 0;
|
|
1611
|
-
o |= (c2 & 48) >> 4;
|
|
1612
|
-
rs.push(stringFromCharCode(o));
|
|
1613
|
-
if (++olen >= len || off >= slen)
|
|
1614
|
-
break;
|
|
1615
|
-
code = s.charCodeAt(off++);
|
|
1616
|
-
c3 = code < BASE64_INDEX.length ? BASE64_INDEX[code] : -1;
|
|
1617
|
-
if (c3 == -1)
|
|
1618
|
-
break;
|
|
1619
|
-
o = (c2 & 15) << 4 >>> 0;
|
|
1620
|
-
o |= (c3 & 60) >> 2;
|
|
1621
|
-
rs.push(stringFromCharCode(o));
|
|
1622
|
-
if (++olen >= len || off >= slen)
|
|
1623
|
-
break;
|
|
1624
|
-
code = s.charCodeAt(off++);
|
|
1625
|
-
c4 = code < BASE64_INDEX.length ? BASE64_INDEX[code] : -1;
|
|
1626
|
-
o = (c3 & 3) << 6 >>> 0;
|
|
1627
|
-
o |= c4;
|
|
1628
|
-
rs.push(stringFromCharCode(o));
|
|
1629
|
-
++olen;
|
|
1630
|
-
}
|
|
1631
|
-
var res = [];
|
|
1632
|
-
for (off = 0;off < olen; off++)
|
|
1633
|
-
res.push(rs[off].charCodeAt(0));
|
|
1634
|
-
return res;
|
|
1635
|
-
}
|
|
1636
|
-
var utfx = function() {
|
|
1637
|
-
var utfx2 = {};
|
|
1638
|
-
utfx2.MAX_CODEPOINT = 1114111;
|
|
1639
|
-
utfx2.encodeUTF8 = function(src, dst) {
|
|
1640
|
-
var cp = null;
|
|
1641
|
-
if (typeof src === "number")
|
|
1642
|
-
cp = src, src = function() {
|
|
1643
|
-
return null;
|
|
1644
|
-
};
|
|
1645
|
-
while (cp !== null || (cp = src()) !== null) {
|
|
1646
|
-
if (cp < 128)
|
|
1647
|
-
dst(cp & 127);
|
|
1648
|
-
else if (cp < 2048)
|
|
1649
|
-
dst(cp >> 6 & 31 | 192), dst(cp & 63 | 128);
|
|
1650
|
-
else if (cp < 65536)
|
|
1651
|
-
dst(cp >> 12 & 15 | 224), dst(cp >> 6 & 63 | 128), dst(cp & 63 | 128);
|
|
1652
|
-
else
|
|
1653
|
-
dst(cp >> 18 & 7 | 240), dst(cp >> 12 & 63 | 128), dst(cp >> 6 & 63 | 128), dst(cp & 63 | 128);
|
|
1654
|
-
cp = null;
|
|
1655
|
-
}
|
|
1656
|
-
};
|
|
1657
|
-
utfx2.decodeUTF8 = function(src, dst) {
|
|
1658
|
-
var a, b, c, d, fail = function(b2) {
|
|
1659
|
-
b2 = b2.slice(0, b2.indexOf(null));
|
|
1660
|
-
var err = Error(b2.toString());
|
|
1661
|
-
err.name = "TruncatedError";
|
|
1662
|
-
err["bytes"] = b2;
|
|
1663
|
-
throw err;
|
|
1664
|
-
};
|
|
1665
|
-
while ((a = src()) !== null) {
|
|
1666
|
-
if ((a & 128) === 0)
|
|
1667
|
-
dst(a);
|
|
1668
|
-
else if ((a & 224) === 192)
|
|
1669
|
-
(b = src()) === null && fail([a, b]), dst((a & 31) << 6 | b & 63);
|
|
1670
|
-
else if ((a & 240) === 224)
|
|
1671
|
-
((b = src()) === null || (c = src()) === null) && fail([a, b, c]), dst((a & 15) << 12 | (b & 63) << 6 | c & 63);
|
|
1672
|
-
else if ((a & 248) === 240)
|
|
1673
|
-
((b = src()) === null || (c = src()) === null || (d = src()) === null) && fail([a, b, c, d]), dst((a & 7) << 18 | (b & 63) << 12 | (c & 63) << 6 | d & 63);
|
|
1674
|
-
else
|
|
1675
|
-
throw RangeError("Illegal starting byte: " + a);
|
|
1676
|
-
}
|
|
1677
|
-
};
|
|
1678
|
-
utfx2.UTF16toUTF8 = function(src, dst) {
|
|
1679
|
-
var c1, c2 = null;
|
|
1680
|
-
while (true) {
|
|
1681
|
-
if ((c1 = c2 !== null ? c2 : src()) === null)
|
|
1682
|
-
break;
|
|
1683
|
-
if (c1 >= 55296 && c1 <= 57343) {
|
|
1684
|
-
if ((c2 = src()) !== null) {
|
|
1685
|
-
if (c2 >= 56320 && c2 <= 57343) {
|
|
1686
|
-
dst((c1 - 55296) * 1024 + c2 - 56320 + 65536);
|
|
1687
|
-
c2 = null;
|
|
1688
|
-
continue;
|
|
1689
|
-
}
|
|
1690
|
-
}
|
|
1691
|
-
}
|
|
1692
|
-
dst(c1);
|
|
1693
|
-
}
|
|
1694
|
-
if (c2 !== null)
|
|
1695
|
-
dst(c2);
|
|
1696
|
-
};
|
|
1697
|
-
utfx2.UTF8toUTF16 = function(src, dst) {
|
|
1698
|
-
var cp = null;
|
|
1699
|
-
if (typeof src === "number")
|
|
1700
|
-
cp = src, src = function() {
|
|
1701
|
-
return null;
|
|
1702
|
-
};
|
|
1703
|
-
while (cp !== null || (cp = src()) !== null) {
|
|
1704
|
-
if (cp <= 65535)
|
|
1705
|
-
dst(cp);
|
|
1706
|
-
else
|
|
1707
|
-
cp -= 65536, dst((cp >> 10) + 55296), dst(cp % 1024 + 56320);
|
|
1708
|
-
cp = null;
|
|
1709
|
-
}
|
|
1710
|
-
};
|
|
1711
|
-
utfx2.encodeUTF16toUTF8 = function(src, dst) {
|
|
1712
|
-
utfx2.UTF16toUTF8(src, function(cp) {
|
|
1713
|
-
utfx2.encodeUTF8(cp, dst);
|
|
1714
|
-
});
|
|
1715
|
-
};
|
|
1716
|
-
utfx2.decodeUTF8toUTF16 = function(src, dst) {
|
|
1717
|
-
utfx2.decodeUTF8(src, function(cp) {
|
|
1718
|
-
utfx2.UTF8toUTF16(cp, dst);
|
|
1719
|
-
});
|
|
1720
|
-
};
|
|
1721
|
-
utfx2.calculateCodePoint = function(cp) {
|
|
1722
|
-
return cp < 128 ? 1 : cp < 2048 ? 2 : cp < 65536 ? 3 : 4;
|
|
1723
|
-
};
|
|
1724
|
-
utfx2.calculateUTF8 = function(src) {
|
|
1725
|
-
var cp, l = 0;
|
|
1726
|
-
while ((cp = src()) !== null)
|
|
1727
|
-
l += utfx2.calculateCodePoint(cp);
|
|
1728
|
-
return l;
|
|
1729
|
-
};
|
|
1730
|
-
utfx2.calculateUTF16asUTF8 = function(src) {
|
|
1731
|
-
var n = 0, l = 0;
|
|
1732
|
-
utfx2.UTF16toUTF8(src, function(cp) {
|
|
1733
|
-
++n;
|
|
1734
|
-
l += utfx2.calculateCodePoint(cp);
|
|
1735
|
-
});
|
|
1736
|
-
return [n, l];
|
|
1737
|
-
};
|
|
1738
|
-
return utfx2;
|
|
1739
|
-
}();
|
|
1740
|
-
Date.now = Date.now || function() {
|
|
1741
|
-
return +new Date;
|
|
1742
|
-
};
|
|
1743
|
-
var BCRYPT_SALT_LEN = 16;
|
|
1744
|
-
var GENSALT_DEFAULT_LOG2_ROUNDS = 10;
|
|
1745
|
-
var BLOWFISH_NUM_ROUNDS = 16;
|
|
1746
|
-
var MAX_EXECUTION_TIME = 100;
|
|
1747
|
-
var P_ORIG = [
|
|
1748
|
-
608135816,
|
|
1749
|
-
2242054355,
|
|
1750
|
-
320440878,
|
|
1751
|
-
57701188,
|
|
1752
|
-
2752067618,
|
|
1753
|
-
698298832,
|
|
1754
|
-
137296536,
|
|
1755
|
-
3964562569,
|
|
1756
|
-
1160258022,
|
|
1757
|
-
953160567,
|
|
1758
|
-
3193202383,
|
|
1759
|
-
887688300,
|
|
1760
|
-
3232508343,
|
|
1761
|
-
3380367581,
|
|
1762
|
-
1065670069,
|
|
1763
|
-
3041331479,
|
|
1764
|
-
2450970073,
|
|
1765
|
-
2306472731
|
|
1766
|
-
];
|
|
1767
|
-
var S_ORIG = [
|
|
1768
|
-
3509652390,
|
|
1769
|
-
2564797868,
|
|
1770
|
-
805139163,
|
|
1771
|
-
3491422135,
|
|
1772
|
-
3101798381,
|
|
1773
|
-
1780907670,
|
|
1774
|
-
3128725573,
|
|
1775
|
-
4046225305,
|
|
1776
|
-
614570311,
|
|
1777
|
-
3012652279,
|
|
1778
|
-
134345442,
|
|
1779
|
-
2240740374,
|
|
1780
|
-
1667834072,
|
|
1781
|
-
1901547113,
|
|
1782
|
-
2757295779,
|
|
1783
|
-
4103290238,
|
|
1784
|
-
227898511,
|
|
1785
|
-
1921955416,
|
|
1786
|
-
1904987480,
|
|
1787
|
-
2182433518,
|
|
1788
|
-
2069144605,
|
|
1789
|
-
3260701109,
|
|
1790
|
-
2620446009,
|
|
1791
|
-
720527379,
|
|
1792
|
-
3318853667,
|
|
1793
|
-
677414384,
|
|
1794
|
-
3393288472,
|
|
1795
|
-
3101374703,
|
|
1796
|
-
2390351024,
|
|
1797
|
-
1614419982,
|
|
1798
|
-
1822297739,
|
|
1799
|
-
2954791486,
|
|
1800
|
-
3608508353,
|
|
1801
|
-
3174124327,
|
|
1802
|
-
2024746970,
|
|
1803
|
-
1432378464,
|
|
1804
|
-
3864339955,
|
|
1805
|
-
2857741204,
|
|
1806
|
-
1464375394,
|
|
1807
|
-
1676153920,
|
|
1808
|
-
1439316330,
|
|
1809
|
-
715854006,
|
|
1810
|
-
3033291828,
|
|
1811
|
-
289532110,
|
|
1812
|
-
2706671279,
|
|
1813
|
-
2087905683,
|
|
1814
|
-
3018724369,
|
|
1815
|
-
1668267050,
|
|
1816
|
-
732546397,
|
|
1817
|
-
1947742710,
|
|
1818
|
-
3462151702,
|
|
1819
|
-
2609353502,
|
|
1820
|
-
2950085171,
|
|
1821
|
-
1814351708,
|
|
1822
|
-
2050118529,
|
|
1823
|
-
680887927,
|
|
1824
|
-
999245976,
|
|
1825
|
-
1800124847,
|
|
1826
|
-
3300911131,
|
|
1827
|
-
1713906067,
|
|
1828
|
-
1641548236,
|
|
1829
|
-
4213287313,
|
|
1830
|
-
1216130144,
|
|
1831
|
-
1575780402,
|
|
1832
|
-
4018429277,
|
|
1833
|
-
3917837745,
|
|
1834
|
-
3693486850,
|
|
1835
|
-
3949271944,
|
|
1836
|
-
596196993,
|
|
1837
|
-
3549867205,
|
|
1838
|
-
258830323,
|
|
1839
|
-
2213823033,
|
|
1840
|
-
772490370,
|
|
1841
|
-
2760122372,
|
|
1842
|
-
1774776394,
|
|
1843
|
-
2652871518,
|
|
1844
|
-
566650946,
|
|
1845
|
-
4142492826,
|
|
1846
|
-
1728879713,
|
|
1847
|
-
2882767088,
|
|
1848
|
-
1783734482,
|
|
1849
|
-
3629395816,
|
|
1850
|
-
2517608232,
|
|
1851
|
-
2874225571,
|
|
1852
|
-
1861159788,
|
|
1853
|
-
326777828,
|
|
1854
|
-
3124490320,
|
|
1855
|
-
2130389656,
|
|
1856
|
-
2716951837,
|
|
1857
|
-
967770486,
|
|
1858
|
-
1724537150,
|
|
1859
|
-
2185432712,
|
|
1860
|
-
2364442137,
|
|
1861
|
-
1164943284,
|
|
1862
|
-
2105845187,
|
|
1863
|
-
998989502,
|
|
1864
|
-
3765401048,
|
|
1865
|
-
2244026483,
|
|
1866
|
-
1075463327,
|
|
1867
|
-
1455516326,
|
|
1868
|
-
1322494562,
|
|
1869
|
-
910128902,
|
|
1870
|
-
469688178,
|
|
1871
|
-
1117454909,
|
|
1872
|
-
936433444,
|
|
1873
|
-
3490320968,
|
|
1874
|
-
3675253459,
|
|
1875
|
-
1240580251,
|
|
1876
|
-
122909385,
|
|
1877
|
-
2157517691,
|
|
1878
|
-
634681816,
|
|
1879
|
-
4142456567,
|
|
1880
|
-
3825094682,
|
|
1881
|
-
3061402683,
|
|
1882
|
-
2540495037,
|
|
1883
|
-
79693498,
|
|
1884
|
-
3249098678,
|
|
1885
|
-
1084186820,
|
|
1886
|
-
1583128258,
|
|
1887
|
-
426386531,
|
|
1888
|
-
1761308591,
|
|
1889
|
-
1047286709,
|
|
1890
|
-
322548459,
|
|
1891
|
-
995290223,
|
|
1892
|
-
1845252383,
|
|
1893
|
-
2603652396,
|
|
1894
|
-
3431023940,
|
|
1895
|
-
2942221577,
|
|
1896
|
-
3202600964,
|
|
1897
|
-
3727903485,
|
|
1898
|
-
1712269319,
|
|
1899
|
-
422464435,
|
|
1900
|
-
3234572375,
|
|
1901
|
-
1170764815,
|
|
1902
|
-
3523960633,
|
|
1903
|
-
3117677531,
|
|
1904
|
-
1434042557,
|
|
1905
|
-
442511882,
|
|
1906
|
-
3600875718,
|
|
1907
|
-
1076654713,
|
|
1908
|
-
1738483198,
|
|
1909
|
-
4213154764,
|
|
1910
|
-
2393238008,
|
|
1911
|
-
3677496056,
|
|
1912
|
-
1014306527,
|
|
1913
|
-
4251020053,
|
|
1914
|
-
793779912,
|
|
1915
|
-
2902807211,
|
|
1916
|
-
842905082,
|
|
1917
|
-
4246964064,
|
|
1918
|
-
1395751752,
|
|
1919
|
-
1040244610,
|
|
1920
|
-
2656851899,
|
|
1921
|
-
3396308128,
|
|
1922
|
-
445077038,
|
|
1923
|
-
3742853595,
|
|
1924
|
-
3577915638,
|
|
1925
|
-
679411651,
|
|
1926
|
-
2892444358,
|
|
1927
|
-
2354009459,
|
|
1928
|
-
1767581616,
|
|
1929
|
-
3150600392,
|
|
1930
|
-
3791627101,
|
|
1931
|
-
3102740896,
|
|
1932
|
-
284835224,
|
|
1933
|
-
4246832056,
|
|
1934
|
-
1258075500,
|
|
1935
|
-
768725851,
|
|
1936
|
-
2589189241,
|
|
1937
|
-
3069724005,
|
|
1938
|
-
3532540348,
|
|
1939
|
-
1274779536,
|
|
1940
|
-
3789419226,
|
|
1941
|
-
2764799539,
|
|
1942
|
-
1660621633,
|
|
1943
|
-
3471099624,
|
|
1944
|
-
4011903706,
|
|
1945
|
-
913787905,
|
|
1946
|
-
3497959166,
|
|
1947
|
-
737222580,
|
|
1948
|
-
2514213453,
|
|
1949
|
-
2928710040,
|
|
1950
|
-
3937242737,
|
|
1951
|
-
1804850592,
|
|
1952
|
-
3499020752,
|
|
1953
|
-
2949064160,
|
|
1954
|
-
2386320175,
|
|
1955
|
-
2390070455,
|
|
1956
|
-
2415321851,
|
|
1957
|
-
4061277028,
|
|
1958
|
-
2290661394,
|
|
1959
|
-
2416832540,
|
|
1960
|
-
1336762016,
|
|
1961
|
-
1754252060,
|
|
1962
|
-
3520065937,
|
|
1963
|
-
3014181293,
|
|
1964
|
-
791618072,
|
|
1965
|
-
3188594551,
|
|
1966
|
-
3933548030,
|
|
1967
|
-
2332172193,
|
|
1968
|
-
3852520463,
|
|
1969
|
-
3043980520,
|
|
1970
|
-
413987798,
|
|
1971
|
-
3465142937,
|
|
1972
|
-
3030929376,
|
|
1973
|
-
4245938359,
|
|
1974
|
-
2093235073,
|
|
1975
|
-
3534596313,
|
|
1976
|
-
375366246,
|
|
1977
|
-
2157278981,
|
|
1978
|
-
2479649556,
|
|
1979
|
-
555357303,
|
|
1980
|
-
3870105701,
|
|
1981
|
-
2008414854,
|
|
1982
|
-
3344188149,
|
|
1983
|
-
4221384143,
|
|
1984
|
-
3956125452,
|
|
1985
|
-
2067696032,
|
|
1986
|
-
3594591187,
|
|
1987
|
-
2921233993,
|
|
1988
|
-
2428461,
|
|
1989
|
-
544322398,
|
|
1990
|
-
577241275,
|
|
1991
|
-
1471733935,
|
|
1992
|
-
610547355,
|
|
1993
|
-
4027169054,
|
|
1994
|
-
1432588573,
|
|
1995
|
-
1507829418,
|
|
1996
|
-
2025931657,
|
|
1997
|
-
3646575487,
|
|
1998
|
-
545086370,
|
|
1999
|
-
48609733,
|
|
2000
|
-
2200306550,
|
|
2001
|
-
1653985193,
|
|
2002
|
-
298326376,
|
|
2003
|
-
1316178497,
|
|
2004
|
-
3007786442,
|
|
2005
|
-
2064951626,
|
|
2006
|
-
458293330,
|
|
2007
|
-
2589141269,
|
|
2008
|
-
3591329599,
|
|
2009
|
-
3164325604,
|
|
2010
|
-
727753846,
|
|
2011
|
-
2179363840,
|
|
2012
|
-
146436021,
|
|
2013
|
-
1461446943,
|
|
2014
|
-
4069977195,
|
|
2015
|
-
705550613,
|
|
2016
|
-
3059967265,
|
|
2017
|
-
3887724982,
|
|
2018
|
-
4281599278,
|
|
2019
|
-
3313849956,
|
|
2020
|
-
1404054877,
|
|
2021
|
-
2845806497,
|
|
2022
|
-
146425753,
|
|
2023
|
-
1854211946,
|
|
2024
|
-
1266315497,
|
|
2025
|
-
3048417604,
|
|
2026
|
-
3681880366,
|
|
2027
|
-
3289982499,
|
|
2028
|
-
2909710000,
|
|
2029
|
-
1235738493,
|
|
2030
|
-
2632868024,
|
|
2031
|
-
2414719590,
|
|
2032
|
-
3970600049,
|
|
2033
|
-
1771706367,
|
|
2034
|
-
1449415276,
|
|
2035
|
-
3266420449,
|
|
2036
|
-
422970021,
|
|
2037
|
-
1963543593,
|
|
2038
|
-
2690192192,
|
|
2039
|
-
3826793022,
|
|
2040
|
-
1062508698,
|
|
2041
|
-
1531092325,
|
|
2042
|
-
1804592342,
|
|
2043
|
-
2583117782,
|
|
2044
|
-
2714934279,
|
|
2045
|
-
4024971509,
|
|
2046
|
-
1294809318,
|
|
2047
|
-
4028980673,
|
|
2048
|
-
1289560198,
|
|
2049
|
-
2221992742,
|
|
2050
|
-
1669523910,
|
|
2051
|
-
35572830,
|
|
2052
|
-
157838143,
|
|
2053
|
-
1052438473,
|
|
2054
|
-
1016535060,
|
|
2055
|
-
1802137761,
|
|
2056
|
-
1753167236,
|
|
2057
|
-
1386275462,
|
|
2058
|
-
3080475397,
|
|
2059
|
-
2857371447,
|
|
2060
|
-
1040679964,
|
|
2061
|
-
2145300060,
|
|
2062
|
-
2390574316,
|
|
2063
|
-
1461121720,
|
|
2064
|
-
2956646967,
|
|
2065
|
-
4031777805,
|
|
2066
|
-
4028374788,
|
|
2067
|
-
33600511,
|
|
2068
|
-
2920084762,
|
|
2069
|
-
1018524850,
|
|
2070
|
-
629373528,
|
|
2071
|
-
3691585981,
|
|
2072
|
-
3515945977,
|
|
2073
|
-
2091462646,
|
|
2074
|
-
2486323059,
|
|
2075
|
-
586499841,
|
|
2076
|
-
988145025,
|
|
2077
|
-
935516892,
|
|
2078
|
-
3367335476,
|
|
2079
|
-
2599673255,
|
|
2080
|
-
2839830854,
|
|
2081
|
-
265290510,
|
|
2082
|
-
3972581182,
|
|
2083
|
-
2759138881,
|
|
2084
|
-
3795373465,
|
|
2085
|
-
1005194799,
|
|
2086
|
-
847297441,
|
|
2087
|
-
406762289,
|
|
2088
|
-
1314163512,
|
|
2089
|
-
1332590856,
|
|
2090
|
-
1866599683,
|
|
2091
|
-
4127851711,
|
|
2092
|
-
750260880,
|
|
2093
|
-
613907577,
|
|
2094
|
-
1450815602,
|
|
2095
|
-
3165620655,
|
|
2096
|
-
3734664991,
|
|
2097
|
-
3650291728,
|
|
2098
|
-
3012275730,
|
|
2099
|
-
3704569646,
|
|
2100
|
-
1427272223,
|
|
2101
|
-
778793252,
|
|
2102
|
-
1343938022,
|
|
2103
|
-
2676280711,
|
|
2104
|
-
2052605720,
|
|
2105
|
-
1946737175,
|
|
2106
|
-
3164576444,
|
|
2107
|
-
3914038668,
|
|
2108
|
-
3967478842,
|
|
2109
|
-
3682934266,
|
|
2110
|
-
1661551462,
|
|
2111
|
-
3294938066,
|
|
2112
|
-
4011595847,
|
|
2113
|
-
840292616,
|
|
2114
|
-
3712170807,
|
|
2115
|
-
616741398,
|
|
2116
|
-
312560963,
|
|
2117
|
-
711312465,
|
|
2118
|
-
1351876610,
|
|
2119
|
-
322626781,
|
|
2120
|
-
1910503582,
|
|
2121
|
-
271666773,
|
|
2122
|
-
2175563734,
|
|
2123
|
-
1594956187,
|
|
2124
|
-
70604529,
|
|
2125
|
-
3617834859,
|
|
2126
|
-
1007753275,
|
|
2127
|
-
1495573769,
|
|
2128
|
-
4069517037,
|
|
2129
|
-
2549218298,
|
|
2130
|
-
2663038764,
|
|
2131
|
-
504708206,
|
|
2132
|
-
2263041392,
|
|
2133
|
-
3941167025,
|
|
2134
|
-
2249088522,
|
|
2135
|
-
1514023603,
|
|
2136
|
-
1998579484,
|
|
2137
|
-
1312622330,
|
|
2138
|
-
694541497,
|
|
2139
|
-
2582060303,
|
|
2140
|
-
2151582166,
|
|
2141
|
-
1382467621,
|
|
2142
|
-
776784248,
|
|
2143
|
-
2618340202,
|
|
2144
|
-
3323268794,
|
|
2145
|
-
2497899128,
|
|
2146
|
-
2784771155,
|
|
2147
|
-
503983604,
|
|
2148
|
-
4076293799,
|
|
2149
|
-
907881277,
|
|
2150
|
-
423175695,
|
|
2151
|
-
432175456,
|
|
2152
|
-
1378068232,
|
|
2153
|
-
4145222326,
|
|
2154
|
-
3954048622,
|
|
2155
|
-
3938656102,
|
|
2156
|
-
3820766613,
|
|
2157
|
-
2793130115,
|
|
2158
|
-
2977904593,
|
|
2159
|
-
26017576,
|
|
2160
|
-
3274890735,
|
|
2161
|
-
3194772133,
|
|
2162
|
-
1700274565,
|
|
2163
|
-
1756076034,
|
|
2164
|
-
4006520079,
|
|
2165
|
-
3677328699,
|
|
2166
|
-
720338349,
|
|
2167
|
-
1533947780,
|
|
2168
|
-
354530856,
|
|
2169
|
-
688349552,
|
|
2170
|
-
3973924725,
|
|
2171
|
-
1637815568,
|
|
2172
|
-
332179504,
|
|
2173
|
-
3949051286,
|
|
2174
|
-
53804574,
|
|
2175
|
-
2852348879,
|
|
2176
|
-
3044236432,
|
|
2177
|
-
1282449977,
|
|
2178
|
-
3583942155,
|
|
2179
|
-
3416972820,
|
|
2180
|
-
4006381244,
|
|
2181
|
-
1617046695,
|
|
2182
|
-
2628476075,
|
|
2183
|
-
3002303598,
|
|
2184
|
-
1686838959,
|
|
2185
|
-
431878346,
|
|
2186
|
-
2686675385,
|
|
2187
|
-
1700445008,
|
|
2188
|
-
1080580658,
|
|
2189
|
-
1009431731,
|
|
2190
|
-
832498133,
|
|
2191
|
-
3223435511,
|
|
2192
|
-
2605976345,
|
|
2193
|
-
2271191193,
|
|
2194
|
-
2516031870,
|
|
2195
|
-
1648197032,
|
|
2196
|
-
4164389018,
|
|
2197
|
-
2548247927,
|
|
2198
|
-
300782431,
|
|
2199
|
-
375919233,
|
|
2200
|
-
238389289,
|
|
2201
|
-
3353747414,
|
|
2202
|
-
2531188641,
|
|
2203
|
-
2019080857,
|
|
2204
|
-
1475708069,
|
|
2205
|
-
455242339,
|
|
2206
|
-
2609103871,
|
|
2207
|
-
448939670,
|
|
2208
|
-
3451063019,
|
|
2209
|
-
1395535956,
|
|
2210
|
-
2413381860,
|
|
2211
|
-
1841049896,
|
|
2212
|
-
1491858159,
|
|
2213
|
-
885456874,
|
|
2214
|
-
4264095073,
|
|
2215
|
-
4001119347,
|
|
2216
|
-
1565136089,
|
|
2217
|
-
3898914787,
|
|
2218
|
-
1108368660,
|
|
2219
|
-
540939232,
|
|
2220
|
-
1173283510,
|
|
2221
|
-
2745871338,
|
|
2222
|
-
3681308437,
|
|
2223
|
-
4207628240,
|
|
2224
|
-
3343053890,
|
|
2225
|
-
4016749493,
|
|
2226
|
-
1699691293,
|
|
2227
|
-
1103962373,
|
|
2228
|
-
3625875870,
|
|
2229
|
-
2256883143,
|
|
2230
|
-
3830138730,
|
|
2231
|
-
1031889488,
|
|
2232
|
-
3479347698,
|
|
2233
|
-
1535977030,
|
|
2234
|
-
4236805024,
|
|
2235
|
-
3251091107,
|
|
2236
|
-
2132092099,
|
|
2237
|
-
1774941330,
|
|
2238
|
-
1199868427,
|
|
2239
|
-
1452454533,
|
|
2240
|
-
157007616,
|
|
2241
|
-
2904115357,
|
|
2242
|
-
342012276,
|
|
2243
|
-
595725824,
|
|
2244
|
-
1480756522,
|
|
2245
|
-
206960106,
|
|
2246
|
-
497939518,
|
|
2247
|
-
591360097,
|
|
2248
|
-
863170706,
|
|
2249
|
-
2375253569,
|
|
2250
|
-
3596610801,
|
|
2251
|
-
1814182875,
|
|
2252
|
-
2094937945,
|
|
2253
|
-
3421402208,
|
|
2254
|
-
1082520231,
|
|
2255
|
-
3463918190,
|
|
2256
|
-
2785509508,
|
|
2257
|
-
435703966,
|
|
2258
|
-
3908032597,
|
|
2259
|
-
1641649973,
|
|
2260
|
-
2842273706,
|
|
2261
|
-
3305899714,
|
|
2262
|
-
1510255612,
|
|
2263
|
-
2148256476,
|
|
2264
|
-
2655287854,
|
|
2265
|
-
3276092548,
|
|
2266
|
-
4258621189,
|
|
2267
|
-
236887753,
|
|
2268
|
-
3681803219,
|
|
2269
|
-
274041037,
|
|
2270
|
-
1734335097,
|
|
2271
|
-
3815195456,
|
|
2272
|
-
3317970021,
|
|
2273
|
-
1899903192,
|
|
2274
|
-
1026095262,
|
|
2275
|
-
4050517792,
|
|
2276
|
-
356393447,
|
|
2277
|
-
2410691914,
|
|
2278
|
-
3873677099,
|
|
2279
|
-
3682840055,
|
|
2280
|
-
3913112168,
|
|
2281
|
-
2491498743,
|
|
2282
|
-
4132185628,
|
|
2283
|
-
2489919796,
|
|
2284
|
-
1091903735,
|
|
2285
|
-
1979897079,
|
|
2286
|
-
3170134830,
|
|
2287
|
-
3567386728,
|
|
2288
|
-
3557303409,
|
|
2289
|
-
857797738,
|
|
2290
|
-
1136121015,
|
|
2291
|
-
1342202287,
|
|
2292
|
-
507115054,
|
|
2293
|
-
2535736646,
|
|
2294
|
-
337727348,
|
|
2295
|
-
3213592640,
|
|
2296
|
-
1301675037,
|
|
2297
|
-
2528481711,
|
|
2298
|
-
1895095763,
|
|
2299
|
-
1721773893,
|
|
2300
|
-
3216771564,
|
|
2301
|
-
62756741,
|
|
2302
|
-
2142006736,
|
|
2303
|
-
835421444,
|
|
2304
|
-
2531993523,
|
|
2305
|
-
1442658625,
|
|
2306
|
-
3659876326,
|
|
2307
|
-
2882144922,
|
|
2308
|
-
676362277,
|
|
2309
|
-
1392781812,
|
|
2310
|
-
170690266,
|
|
2311
|
-
3921047035,
|
|
2312
|
-
1759253602,
|
|
2313
|
-
3611846912,
|
|
2314
|
-
1745797284,
|
|
2315
|
-
664899054,
|
|
2316
|
-
1329594018,
|
|
2317
|
-
3901205900,
|
|
2318
|
-
3045908486,
|
|
2319
|
-
2062866102,
|
|
2320
|
-
2865634940,
|
|
2321
|
-
3543621612,
|
|
2322
|
-
3464012697,
|
|
2323
|
-
1080764994,
|
|
2324
|
-
553557557,
|
|
2325
|
-
3656615353,
|
|
2326
|
-
3996768171,
|
|
2327
|
-
991055499,
|
|
2328
|
-
499776247,
|
|
2329
|
-
1265440854,
|
|
2330
|
-
648242737,
|
|
2331
|
-
3940784050,
|
|
2332
|
-
980351604,
|
|
2333
|
-
3713745714,
|
|
2334
|
-
1749149687,
|
|
2335
|
-
3396870395,
|
|
2336
|
-
4211799374,
|
|
2337
|
-
3640570775,
|
|
2338
|
-
1161844396,
|
|
2339
|
-
3125318951,
|
|
2340
|
-
1431517754,
|
|
2341
|
-
545492359,
|
|
2342
|
-
4268468663,
|
|
2343
|
-
3499529547,
|
|
2344
|
-
1437099964,
|
|
2345
|
-
2702547544,
|
|
2346
|
-
3433638243,
|
|
2347
|
-
2581715763,
|
|
2348
|
-
2787789398,
|
|
2349
|
-
1060185593,
|
|
2350
|
-
1593081372,
|
|
2351
|
-
2418618748,
|
|
2352
|
-
4260947970,
|
|
2353
|
-
69676912,
|
|
2354
|
-
2159744348,
|
|
2355
|
-
86519011,
|
|
2356
|
-
2512459080,
|
|
2357
|
-
3838209314,
|
|
2358
|
-
1220612927,
|
|
2359
|
-
3339683548,
|
|
2360
|
-
133810670,
|
|
2361
|
-
1090789135,
|
|
2362
|
-
1078426020,
|
|
2363
|
-
1569222167,
|
|
2364
|
-
845107691,
|
|
2365
|
-
3583754449,
|
|
2366
|
-
4072456591,
|
|
2367
|
-
1091646820,
|
|
2368
|
-
628848692,
|
|
2369
|
-
1613405280,
|
|
2370
|
-
3757631651,
|
|
2371
|
-
526609435,
|
|
2372
|
-
236106946,
|
|
2373
|
-
48312990,
|
|
2374
|
-
2942717905,
|
|
2375
|
-
3402727701,
|
|
2376
|
-
1797494240,
|
|
2377
|
-
859738849,
|
|
2378
|
-
992217954,
|
|
2379
|
-
4005476642,
|
|
2380
|
-
2243076622,
|
|
2381
|
-
3870952857,
|
|
2382
|
-
3732016268,
|
|
2383
|
-
765654824,
|
|
2384
|
-
3490871365,
|
|
2385
|
-
2511836413,
|
|
2386
|
-
1685915746,
|
|
2387
|
-
3888969200,
|
|
2388
|
-
1414112111,
|
|
2389
|
-
2273134842,
|
|
2390
|
-
3281911079,
|
|
2391
|
-
4080962846,
|
|
2392
|
-
172450625,
|
|
2393
|
-
2569994100,
|
|
2394
|
-
980381355,
|
|
2395
|
-
4109958455,
|
|
2396
|
-
2819808352,
|
|
2397
|
-
2716589560,
|
|
2398
|
-
2568741196,
|
|
2399
|
-
3681446669,
|
|
2400
|
-
3329971472,
|
|
2401
|
-
1835478071,
|
|
2402
|
-
660984891,
|
|
2403
|
-
3704678404,
|
|
2404
|
-
4045999559,
|
|
2405
|
-
3422617507,
|
|
2406
|
-
3040415634,
|
|
2407
|
-
1762651403,
|
|
2408
|
-
1719377915,
|
|
2409
|
-
3470491036,
|
|
2410
|
-
2693910283,
|
|
2411
|
-
3642056355,
|
|
2412
|
-
3138596744,
|
|
2413
|
-
1364962596,
|
|
2414
|
-
2073328063,
|
|
2415
|
-
1983633131,
|
|
2416
|
-
926494387,
|
|
2417
|
-
3423689081,
|
|
2418
|
-
2150032023,
|
|
2419
|
-
4096667949,
|
|
2420
|
-
1749200295,
|
|
2421
|
-
3328846651,
|
|
2422
|
-
309677260,
|
|
2423
|
-
2016342300,
|
|
2424
|
-
1779581495,
|
|
2425
|
-
3079819751,
|
|
2426
|
-
111262694,
|
|
2427
|
-
1274766160,
|
|
2428
|
-
443224088,
|
|
2429
|
-
298511866,
|
|
2430
|
-
1025883608,
|
|
2431
|
-
3806446537,
|
|
2432
|
-
1145181785,
|
|
2433
|
-
168956806,
|
|
2434
|
-
3641502830,
|
|
2435
|
-
3584813610,
|
|
2436
|
-
1689216846,
|
|
2437
|
-
3666258015,
|
|
2438
|
-
3200248200,
|
|
2439
|
-
1692713982,
|
|
2440
|
-
2646376535,
|
|
2441
|
-
4042768518,
|
|
2442
|
-
1618508792,
|
|
2443
|
-
1610833997,
|
|
2444
|
-
3523052358,
|
|
2445
|
-
4130873264,
|
|
2446
|
-
2001055236,
|
|
2447
|
-
3610705100,
|
|
2448
|
-
2202168115,
|
|
2449
|
-
4028541809,
|
|
2450
|
-
2961195399,
|
|
2451
|
-
1006657119,
|
|
2452
|
-
2006996926,
|
|
2453
|
-
3186142756,
|
|
2454
|
-
1430667929,
|
|
2455
|
-
3210227297,
|
|
2456
|
-
1314452623,
|
|
2457
|
-
4074634658,
|
|
2458
|
-
4101304120,
|
|
2459
|
-
2273951170,
|
|
2460
|
-
1399257539,
|
|
2461
|
-
3367210612,
|
|
2462
|
-
3027628629,
|
|
2463
|
-
1190975929,
|
|
2464
|
-
2062231137,
|
|
2465
|
-
2333990788,
|
|
2466
|
-
2221543033,
|
|
2467
|
-
2438960610,
|
|
2468
|
-
1181637006,
|
|
2469
|
-
548689776,
|
|
2470
|
-
2362791313,
|
|
2471
|
-
3372408396,
|
|
2472
|
-
3104550113,
|
|
2473
|
-
3145860560,
|
|
2474
|
-
296247880,
|
|
2475
|
-
1970579870,
|
|
2476
|
-
3078560182,
|
|
2477
|
-
3769228297,
|
|
2478
|
-
1714227617,
|
|
2479
|
-
3291629107,
|
|
2480
|
-
3898220290,
|
|
2481
|
-
166772364,
|
|
2482
|
-
1251581989,
|
|
2483
|
-
493813264,
|
|
2484
|
-
448347421,
|
|
2485
|
-
195405023,
|
|
2486
|
-
2709975567,
|
|
2487
|
-
677966185,
|
|
2488
|
-
3703036547,
|
|
2489
|
-
1463355134,
|
|
2490
|
-
2715995803,
|
|
2491
|
-
1338867538,
|
|
2492
|
-
1343315457,
|
|
2493
|
-
2802222074,
|
|
2494
|
-
2684532164,
|
|
2495
|
-
233230375,
|
|
2496
|
-
2599980071,
|
|
2497
|
-
2000651841,
|
|
2498
|
-
3277868038,
|
|
2499
|
-
1638401717,
|
|
2500
|
-
4028070440,
|
|
2501
|
-
3237316320,
|
|
2502
|
-
6314154,
|
|
2503
|
-
819756386,
|
|
2504
|
-
300326615,
|
|
2505
|
-
590932579,
|
|
2506
|
-
1405279636,
|
|
2507
|
-
3267499572,
|
|
2508
|
-
3150704214,
|
|
2509
|
-
2428286686,
|
|
2510
|
-
3959192993,
|
|
2511
|
-
3461946742,
|
|
2512
|
-
1862657033,
|
|
2513
|
-
1266418056,
|
|
2514
|
-
963775037,
|
|
2515
|
-
2089974820,
|
|
2516
|
-
2263052895,
|
|
2517
|
-
1917689273,
|
|
2518
|
-
448879540,
|
|
2519
|
-
3550394620,
|
|
2520
|
-
3981727096,
|
|
2521
|
-
150775221,
|
|
2522
|
-
3627908307,
|
|
2523
|
-
1303187396,
|
|
2524
|
-
508620638,
|
|
2525
|
-
2975983352,
|
|
2526
|
-
2726630617,
|
|
2527
|
-
1817252668,
|
|
2528
|
-
1876281319,
|
|
2529
|
-
1457606340,
|
|
2530
|
-
908771278,
|
|
2531
|
-
3720792119,
|
|
2532
|
-
3617206836,
|
|
2533
|
-
2455994898,
|
|
2534
|
-
1729034894,
|
|
2535
|
-
1080033504,
|
|
2536
|
-
976866871,
|
|
2537
|
-
3556439503,
|
|
2538
|
-
2881648439,
|
|
2539
|
-
1522871579,
|
|
2540
|
-
1555064734,
|
|
2541
|
-
1336096578,
|
|
2542
|
-
3548522304,
|
|
2543
|
-
2579274686,
|
|
2544
|
-
3574697629,
|
|
2545
|
-
3205460757,
|
|
2546
|
-
3593280638,
|
|
2547
|
-
3338716283,
|
|
2548
|
-
3079412587,
|
|
2549
|
-
564236357,
|
|
2550
|
-
2993598910,
|
|
2551
|
-
1781952180,
|
|
2552
|
-
1464380207,
|
|
2553
|
-
3163844217,
|
|
2554
|
-
3332601554,
|
|
2555
|
-
1699332808,
|
|
2556
|
-
1393555694,
|
|
2557
|
-
1183702653,
|
|
2558
|
-
3581086237,
|
|
2559
|
-
1288719814,
|
|
2560
|
-
691649499,
|
|
2561
|
-
2847557200,
|
|
2562
|
-
2895455976,
|
|
2563
|
-
3193889540,
|
|
2564
|
-
2717570544,
|
|
2565
|
-
1781354906,
|
|
2566
|
-
1676643554,
|
|
2567
|
-
2592534050,
|
|
2568
|
-
3230253752,
|
|
2569
|
-
1126444790,
|
|
2570
|
-
2770207658,
|
|
2571
|
-
2633158820,
|
|
2572
|
-
2210423226,
|
|
2573
|
-
2615765581,
|
|
2574
|
-
2414155088,
|
|
2575
|
-
3127139286,
|
|
2576
|
-
673620729,
|
|
2577
|
-
2805611233,
|
|
2578
|
-
1269405062,
|
|
2579
|
-
4015350505,
|
|
2580
|
-
3341807571,
|
|
2581
|
-
4149409754,
|
|
2582
|
-
1057255273,
|
|
2583
|
-
2012875353,
|
|
2584
|
-
2162469141,
|
|
2585
|
-
2276492801,
|
|
2586
|
-
2601117357,
|
|
2587
|
-
993977747,
|
|
2588
|
-
3918593370,
|
|
2589
|
-
2654263191,
|
|
2590
|
-
753973209,
|
|
2591
|
-
36408145,
|
|
2592
|
-
2530585658,
|
|
2593
|
-
25011837,
|
|
2594
|
-
3520020182,
|
|
2595
|
-
2088578344,
|
|
2596
|
-
530523599,
|
|
2597
|
-
2918365339,
|
|
2598
|
-
1524020338,
|
|
2599
|
-
1518925132,
|
|
2600
|
-
3760827505,
|
|
2601
|
-
3759777254,
|
|
2602
|
-
1202760957,
|
|
2603
|
-
3985898139,
|
|
2604
|
-
3906192525,
|
|
2605
|
-
674977740,
|
|
2606
|
-
4174734889,
|
|
2607
|
-
2031300136,
|
|
2608
|
-
2019492241,
|
|
2609
|
-
3983892565,
|
|
2610
|
-
4153806404,
|
|
2611
|
-
3822280332,
|
|
2612
|
-
352677332,
|
|
2613
|
-
2297720250,
|
|
2614
|
-
60907813,
|
|
2615
|
-
90501309,
|
|
2616
|
-
3286998549,
|
|
2617
|
-
1016092578,
|
|
2618
|
-
2535922412,
|
|
2619
|
-
2839152426,
|
|
2620
|
-
457141659,
|
|
2621
|
-
509813237,
|
|
2622
|
-
4120667899,
|
|
2623
|
-
652014361,
|
|
2624
|
-
1966332200,
|
|
2625
|
-
2975202805,
|
|
2626
|
-
55981186,
|
|
2627
|
-
2327461051,
|
|
2628
|
-
676427537,
|
|
2629
|
-
3255491064,
|
|
2630
|
-
2882294119,
|
|
2631
|
-
3433927263,
|
|
2632
|
-
1307055953,
|
|
2633
|
-
942726286,
|
|
2634
|
-
933058658,
|
|
2635
|
-
2468411793,
|
|
2636
|
-
3933900994,
|
|
2637
|
-
4215176142,
|
|
2638
|
-
1361170020,
|
|
2639
|
-
2001714738,
|
|
2640
|
-
2830558078,
|
|
2641
|
-
3274259782,
|
|
2642
|
-
1222529897,
|
|
2643
|
-
1679025792,
|
|
2644
|
-
2729314320,
|
|
2645
|
-
3714953764,
|
|
2646
|
-
1770335741,
|
|
2647
|
-
151462246,
|
|
2648
|
-
3013232138,
|
|
2649
|
-
1682292957,
|
|
2650
|
-
1483529935,
|
|
2651
|
-
471910574,
|
|
2652
|
-
1539241949,
|
|
2653
|
-
458788160,
|
|
2654
|
-
3436315007,
|
|
2655
|
-
1807016891,
|
|
2656
|
-
3718408830,
|
|
2657
|
-
978976581,
|
|
2658
|
-
1043663428,
|
|
2659
|
-
3165965781,
|
|
2660
|
-
1927990952,
|
|
2661
|
-
4200891579,
|
|
2662
|
-
2372276910,
|
|
2663
|
-
3208408903,
|
|
2664
|
-
3533431907,
|
|
2665
|
-
1412390302,
|
|
2666
|
-
2931980059,
|
|
2667
|
-
4132332400,
|
|
2668
|
-
1947078029,
|
|
2669
|
-
3881505623,
|
|
2670
|
-
4168226417,
|
|
2671
|
-
2941484381,
|
|
2672
|
-
1077988104,
|
|
2673
|
-
1320477388,
|
|
2674
|
-
886195818,
|
|
2675
|
-
18198404,
|
|
2676
|
-
3786409000,
|
|
2677
|
-
2509781533,
|
|
2678
|
-
112762804,
|
|
2679
|
-
3463356488,
|
|
2680
|
-
1866414978,
|
|
2681
|
-
891333506,
|
|
2682
|
-
18488651,
|
|
2683
|
-
661792760,
|
|
2684
|
-
1628790961,
|
|
2685
|
-
3885187036,
|
|
2686
|
-
3141171499,
|
|
2687
|
-
876946877,
|
|
2688
|
-
2693282273,
|
|
2689
|
-
1372485963,
|
|
2690
|
-
791857591,
|
|
2691
|
-
2686433993,
|
|
2692
|
-
3759982718,
|
|
2693
|
-
3167212022,
|
|
2694
|
-
3472953795,
|
|
2695
|
-
2716379847,
|
|
2696
|
-
445679433,
|
|
2697
|
-
3561995674,
|
|
2698
|
-
3504004811,
|
|
2699
|
-
3574258232,
|
|
2700
|
-
54117162,
|
|
2701
|
-
3331405415,
|
|
2702
|
-
2381918588,
|
|
2703
|
-
3769707343,
|
|
2704
|
-
4154350007,
|
|
2705
|
-
1140177722,
|
|
2706
|
-
4074052095,
|
|
2707
|
-
668550556,
|
|
2708
|
-
3214352940,
|
|
2709
|
-
367459370,
|
|
2710
|
-
261225585,
|
|
2711
|
-
2610173221,
|
|
2712
|
-
4209349473,
|
|
2713
|
-
3468074219,
|
|
2714
|
-
3265815641,
|
|
2715
|
-
314222801,
|
|
2716
|
-
3066103646,
|
|
2717
|
-
3808782860,
|
|
2718
|
-
282218597,
|
|
2719
|
-
3406013506,
|
|
2720
|
-
3773591054,
|
|
2721
|
-
379116347,
|
|
2722
|
-
1285071038,
|
|
2723
|
-
846784868,
|
|
2724
|
-
2669647154,
|
|
2725
|
-
3771962079,
|
|
2726
|
-
3550491691,
|
|
2727
|
-
2305946142,
|
|
2728
|
-
453669953,
|
|
2729
|
-
1268987020,
|
|
2730
|
-
3317592352,
|
|
2731
|
-
3279303384,
|
|
2732
|
-
3744833421,
|
|
2733
|
-
2610507566,
|
|
2734
|
-
3859509063,
|
|
2735
|
-
266596637,
|
|
2736
|
-
3847019092,
|
|
2737
|
-
517658769,
|
|
2738
|
-
3462560207,
|
|
2739
|
-
3443424879,
|
|
2740
|
-
370717030,
|
|
2741
|
-
4247526661,
|
|
2742
|
-
2224018117,
|
|
2743
|
-
4143653529,
|
|
2744
|
-
4112773975,
|
|
2745
|
-
2788324899,
|
|
2746
|
-
2477274417,
|
|
2747
|
-
1456262402,
|
|
2748
|
-
2901442914,
|
|
2749
|
-
1517677493,
|
|
2750
|
-
1846949527,
|
|
2751
|
-
2295493580,
|
|
2752
|
-
3734397586,
|
|
2753
|
-
2176403920,
|
|
2754
|
-
1280348187,
|
|
2755
|
-
1908823572,
|
|
2756
|
-
3871786941,
|
|
2757
|
-
846861322,
|
|
2758
|
-
1172426758,
|
|
2759
|
-
3287448474,
|
|
2760
|
-
3383383037,
|
|
2761
|
-
1655181056,
|
|
2762
|
-
3139813346,
|
|
2763
|
-
901632758,
|
|
2764
|
-
1897031941,
|
|
2765
|
-
2986607138,
|
|
2766
|
-
3066810236,
|
|
2767
|
-
3447102507,
|
|
2768
|
-
1393639104,
|
|
2769
|
-
373351379,
|
|
2770
|
-
950779232,
|
|
2771
|
-
625454576,
|
|
2772
|
-
3124240540,
|
|
2773
|
-
4148612726,
|
|
2774
|
-
2007998917,
|
|
2775
|
-
544563296,
|
|
2776
|
-
2244738638,
|
|
2777
|
-
2330496472,
|
|
2778
|
-
2058025392,
|
|
2779
|
-
1291430526,
|
|
2780
|
-
424198748,
|
|
2781
|
-
50039436,
|
|
2782
|
-
29584100,
|
|
2783
|
-
3605783033,
|
|
2784
|
-
2429876329,
|
|
2785
|
-
2791104160,
|
|
2786
|
-
1057563949,
|
|
2787
|
-
3255363231,
|
|
2788
|
-
3075367218,
|
|
2789
|
-
3463963227,
|
|
2790
|
-
1469046755,
|
|
2791
|
-
985887462
|
|
2792
|
-
];
|
|
2793
|
-
var C_ORIG = [
|
|
2794
|
-
1332899944,
|
|
2795
|
-
1700884034,
|
|
2796
|
-
1701343084,
|
|
2797
|
-
1684370003,
|
|
2798
|
-
1668446532,
|
|
2799
|
-
1869963892
|
|
2800
|
-
];
|
|
2801
|
-
function _encipher(lr, off, P, S) {
|
|
2802
|
-
var n, l = lr[off], r = lr[off + 1];
|
|
2803
|
-
l ^= P[0];
|
|
2804
|
-
n = S[l >>> 24];
|
|
2805
|
-
n += S[256 | l >> 16 & 255];
|
|
2806
|
-
n ^= S[512 | l >> 8 & 255];
|
|
2807
|
-
n += S[768 | l & 255];
|
|
2808
|
-
r ^= n ^ P[1];
|
|
2809
|
-
n = S[r >>> 24];
|
|
2810
|
-
n += S[256 | r >> 16 & 255];
|
|
2811
|
-
n ^= S[512 | r >> 8 & 255];
|
|
2812
|
-
n += S[768 | r & 255];
|
|
2813
|
-
l ^= n ^ P[2];
|
|
2814
|
-
n = S[l >>> 24];
|
|
2815
|
-
n += S[256 | l >> 16 & 255];
|
|
2816
|
-
n ^= S[512 | l >> 8 & 255];
|
|
2817
|
-
n += S[768 | l & 255];
|
|
2818
|
-
r ^= n ^ P[3];
|
|
2819
|
-
n = S[r >>> 24];
|
|
2820
|
-
n += S[256 | r >> 16 & 255];
|
|
2821
|
-
n ^= S[512 | r >> 8 & 255];
|
|
2822
|
-
n += S[768 | r & 255];
|
|
2823
|
-
l ^= n ^ P[4];
|
|
2824
|
-
n = S[l >>> 24];
|
|
2825
|
-
n += S[256 | l >> 16 & 255];
|
|
2826
|
-
n ^= S[512 | l >> 8 & 255];
|
|
2827
|
-
n += S[768 | l & 255];
|
|
2828
|
-
r ^= n ^ P[5];
|
|
2829
|
-
n = S[r >>> 24];
|
|
2830
|
-
n += S[256 | r >> 16 & 255];
|
|
2831
|
-
n ^= S[512 | r >> 8 & 255];
|
|
2832
|
-
n += S[768 | r & 255];
|
|
2833
|
-
l ^= n ^ P[6];
|
|
2834
|
-
n = S[l >>> 24];
|
|
2835
|
-
n += S[256 | l >> 16 & 255];
|
|
2836
|
-
n ^= S[512 | l >> 8 & 255];
|
|
2837
|
-
n += S[768 | l & 255];
|
|
2838
|
-
r ^= n ^ P[7];
|
|
2839
|
-
n = S[r >>> 24];
|
|
2840
|
-
n += S[256 | r >> 16 & 255];
|
|
2841
|
-
n ^= S[512 | r >> 8 & 255];
|
|
2842
|
-
n += S[768 | r & 255];
|
|
2843
|
-
l ^= n ^ P[8];
|
|
2844
|
-
n = S[l >>> 24];
|
|
2845
|
-
n += S[256 | l >> 16 & 255];
|
|
2846
|
-
n ^= S[512 | l >> 8 & 255];
|
|
2847
|
-
n += S[768 | l & 255];
|
|
2848
|
-
r ^= n ^ P[9];
|
|
2849
|
-
n = S[r >>> 24];
|
|
2850
|
-
n += S[256 | r >> 16 & 255];
|
|
2851
|
-
n ^= S[512 | r >> 8 & 255];
|
|
2852
|
-
n += S[768 | r & 255];
|
|
2853
|
-
l ^= n ^ P[10];
|
|
2854
|
-
n = S[l >>> 24];
|
|
2855
|
-
n += S[256 | l >> 16 & 255];
|
|
2856
|
-
n ^= S[512 | l >> 8 & 255];
|
|
2857
|
-
n += S[768 | l & 255];
|
|
2858
|
-
r ^= n ^ P[11];
|
|
2859
|
-
n = S[r >>> 24];
|
|
2860
|
-
n += S[256 | r >> 16 & 255];
|
|
2861
|
-
n ^= S[512 | r >> 8 & 255];
|
|
2862
|
-
n += S[768 | r & 255];
|
|
2863
|
-
l ^= n ^ P[12];
|
|
2864
|
-
n = S[l >>> 24];
|
|
2865
|
-
n += S[256 | l >> 16 & 255];
|
|
2866
|
-
n ^= S[512 | l >> 8 & 255];
|
|
2867
|
-
n += S[768 | l & 255];
|
|
2868
|
-
r ^= n ^ P[13];
|
|
2869
|
-
n = S[r >>> 24];
|
|
2870
|
-
n += S[256 | r >> 16 & 255];
|
|
2871
|
-
n ^= S[512 | r >> 8 & 255];
|
|
2872
|
-
n += S[768 | r & 255];
|
|
2873
|
-
l ^= n ^ P[14];
|
|
2874
|
-
n = S[l >>> 24];
|
|
2875
|
-
n += S[256 | l >> 16 & 255];
|
|
2876
|
-
n ^= S[512 | l >> 8 & 255];
|
|
2877
|
-
n += S[768 | l & 255];
|
|
2878
|
-
r ^= n ^ P[15];
|
|
2879
|
-
n = S[r >>> 24];
|
|
2880
|
-
n += S[256 | r >> 16 & 255];
|
|
2881
|
-
n ^= S[512 | r >> 8 & 255];
|
|
2882
|
-
n += S[768 | r & 255];
|
|
2883
|
-
l ^= n ^ P[16];
|
|
2884
|
-
lr[off] = r ^ P[BLOWFISH_NUM_ROUNDS + 1];
|
|
2885
|
-
lr[off + 1] = l;
|
|
2886
|
-
return lr;
|
|
2887
|
-
}
|
|
2888
|
-
function _streamtoword(data, offp) {
|
|
2889
|
-
for (var i = 0, word = 0;i < 4; ++i)
|
|
2890
|
-
word = word << 8 | data[offp] & 255, offp = (offp + 1) % data.length;
|
|
2891
|
-
return { key: word, offp };
|
|
2892
|
-
}
|
|
2893
|
-
function _key(key, P, S) {
|
|
2894
|
-
var offset = 0, lr = [0, 0], plen = P.length, slen = S.length, sw;
|
|
2895
|
-
for (var i = 0;i < plen; i++)
|
|
2896
|
-
sw = _streamtoword(key, offset), offset = sw.offp, P[i] = P[i] ^ sw.key;
|
|
2897
|
-
for (i = 0;i < plen; i += 2)
|
|
2898
|
-
lr = _encipher(lr, 0, P, S), P[i] = lr[0], P[i + 1] = lr[1];
|
|
2899
|
-
for (i = 0;i < slen; i += 2)
|
|
2900
|
-
lr = _encipher(lr, 0, P, S), S[i] = lr[0], S[i + 1] = lr[1];
|
|
2901
|
-
}
|
|
2902
|
-
function _ekskey(data, key, P, S) {
|
|
2903
|
-
var offp = 0, lr = [0, 0], plen = P.length, slen = S.length, sw;
|
|
2904
|
-
for (var i = 0;i < plen; i++)
|
|
2905
|
-
sw = _streamtoword(key, offp), offp = sw.offp, P[i] = P[i] ^ sw.key;
|
|
2906
|
-
offp = 0;
|
|
2907
|
-
for (i = 0;i < plen; i += 2)
|
|
2908
|
-
sw = _streamtoword(data, offp), offp = sw.offp, lr[0] ^= sw.key, sw = _streamtoword(data, offp), offp = sw.offp, lr[1] ^= sw.key, lr = _encipher(lr, 0, P, S), P[i] = lr[0], P[i + 1] = lr[1];
|
|
2909
|
-
for (i = 0;i < slen; i += 2)
|
|
2910
|
-
sw = _streamtoword(data, offp), offp = sw.offp, lr[0] ^= sw.key, sw = _streamtoword(data, offp), offp = sw.offp, lr[1] ^= sw.key, lr = _encipher(lr, 0, P, S), S[i] = lr[0], S[i + 1] = lr[1];
|
|
2911
|
-
}
|
|
2912
|
-
function _crypt(b, salt, rounds, callback, progressCallback) {
|
|
2913
|
-
var cdata = C_ORIG.slice(), clen = cdata.length, err;
|
|
2914
|
-
if (rounds < 4 || rounds > 31) {
|
|
2915
|
-
err = Error("Illegal number of rounds (4-31): " + rounds);
|
|
2916
|
-
if (callback) {
|
|
2917
|
-
nextTick(callback.bind(this, err));
|
|
2918
|
-
return;
|
|
2919
|
-
} else
|
|
2920
|
-
throw err;
|
|
2921
|
-
}
|
|
2922
|
-
if (salt.length !== BCRYPT_SALT_LEN) {
|
|
2923
|
-
err = Error("Illegal salt length: " + salt.length + " != " + BCRYPT_SALT_LEN);
|
|
2924
|
-
if (callback) {
|
|
2925
|
-
nextTick(callback.bind(this, err));
|
|
2926
|
-
return;
|
|
2927
|
-
} else
|
|
2928
|
-
throw err;
|
|
2929
|
-
}
|
|
2930
|
-
rounds = 1 << rounds >>> 0;
|
|
2931
|
-
var P, S, i = 0, j;
|
|
2932
|
-
if (Int32Array) {
|
|
2933
|
-
P = new Int32Array(P_ORIG);
|
|
2934
|
-
S = new Int32Array(S_ORIG);
|
|
2935
|
-
} else {
|
|
2936
|
-
P = P_ORIG.slice();
|
|
2937
|
-
S = S_ORIG.slice();
|
|
2938
|
-
}
|
|
2939
|
-
_ekskey(salt, b, P, S);
|
|
2940
|
-
function next() {
|
|
2941
|
-
if (progressCallback)
|
|
2942
|
-
progressCallback(i / rounds);
|
|
2943
|
-
if (i < rounds) {
|
|
2944
|
-
var start = Date.now();
|
|
2945
|
-
for (;i < rounds; ) {
|
|
2946
|
-
i = i + 1;
|
|
2947
|
-
_key(b, P, S);
|
|
2948
|
-
_key(salt, P, S);
|
|
2949
|
-
if (Date.now() - start > MAX_EXECUTION_TIME)
|
|
2950
|
-
break;
|
|
2951
|
-
}
|
|
2952
|
-
} else {
|
|
2953
|
-
for (i = 0;i < 64; i++)
|
|
2954
|
-
for (j = 0;j < clen >> 1; j++)
|
|
2955
|
-
_encipher(cdata, j << 1, P, S);
|
|
2956
|
-
var ret = [];
|
|
2957
|
-
for (i = 0;i < clen; i++)
|
|
2958
|
-
ret.push((cdata[i] >> 24 & 255) >>> 0), ret.push((cdata[i] >> 16 & 255) >>> 0), ret.push((cdata[i] >> 8 & 255) >>> 0), ret.push((cdata[i] & 255) >>> 0);
|
|
2959
|
-
if (callback) {
|
|
2960
|
-
callback(null, ret);
|
|
2961
|
-
return;
|
|
2962
|
-
} else
|
|
2963
|
-
return ret;
|
|
2964
|
-
}
|
|
2965
|
-
if (callback)
|
|
2966
|
-
nextTick(next);
|
|
2967
|
-
}
|
|
2968
|
-
if (typeof callback !== "undefined") {
|
|
2969
|
-
next();
|
|
2970
|
-
} else {
|
|
2971
|
-
var res;
|
|
2972
|
-
while (true)
|
|
2973
|
-
if (typeof (res = next()) !== "undefined")
|
|
2974
|
-
return res || [];
|
|
2975
|
-
}
|
|
2976
|
-
}
|
|
2977
|
-
function _hash(s, salt, callback, progressCallback) {
|
|
2978
|
-
var err;
|
|
2979
|
-
if (typeof s !== "string" || typeof salt !== "string") {
|
|
2980
|
-
err = Error("Invalid string / salt: Not a string");
|
|
2981
|
-
if (callback) {
|
|
2982
|
-
nextTick(callback.bind(this, err));
|
|
2983
|
-
return;
|
|
2984
|
-
} else
|
|
2985
|
-
throw err;
|
|
2986
|
-
}
|
|
2987
|
-
var minor, offset;
|
|
2988
|
-
if (salt.charAt(0) !== "$" || salt.charAt(1) !== "2") {
|
|
2989
|
-
err = Error("Invalid salt version: " + salt.substring(0, 2));
|
|
2990
|
-
if (callback) {
|
|
2991
|
-
nextTick(callback.bind(this, err));
|
|
2992
|
-
return;
|
|
2993
|
-
} else
|
|
2994
|
-
throw err;
|
|
2995
|
-
}
|
|
2996
|
-
if (salt.charAt(2) === "$")
|
|
2997
|
-
minor = String.fromCharCode(0), offset = 3;
|
|
2998
|
-
else {
|
|
2999
|
-
minor = salt.charAt(2);
|
|
3000
|
-
if (minor !== "a" && minor !== "b" && minor !== "y" || salt.charAt(3) !== "$") {
|
|
3001
|
-
err = Error("Invalid salt revision: " + salt.substring(2, 4));
|
|
3002
|
-
if (callback) {
|
|
3003
|
-
nextTick(callback.bind(this, err));
|
|
3004
|
-
return;
|
|
3005
|
-
} else
|
|
3006
|
-
throw err;
|
|
3007
|
-
}
|
|
3008
|
-
offset = 4;
|
|
3009
|
-
}
|
|
3010
|
-
if (salt.charAt(offset + 2) > "$") {
|
|
3011
|
-
err = Error("Missing salt rounds");
|
|
3012
|
-
if (callback) {
|
|
3013
|
-
nextTick(callback.bind(this, err));
|
|
3014
|
-
return;
|
|
3015
|
-
} else
|
|
3016
|
-
throw err;
|
|
3017
|
-
}
|
|
3018
|
-
var r1 = parseInt(salt.substring(offset, offset + 1), 10) * 10, r2 = parseInt(salt.substring(offset + 1, offset + 2), 10), rounds = r1 + r2, real_salt = salt.substring(offset + 3, offset + 25);
|
|
3019
|
-
s += minor >= "a" ? "\0" : "";
|
|
3020
|
-
var passwordb = stringToBytes(s), saltb = base64_decode(real_salt, BCRYPT_SALT_LEN);
|
|
3021
|
-
function finish(bytes) {
|
|
3022
|
-
var res = [];
|
|
3023
|
-
res.push("$2");
|
|
3024
|
-
if (minor >= "a")
|
|
3025
|
-
res.push(minor);
|
|
3026
|
-
res.push("$");
|
|
3027
|
-
if (rounds < 10)
|
|
3028
|
-
res.push("0");
|
|
3029
|
-
res.push(rounds.toString());
|
|
3030
|
-
res.push("$");
|
|
3031
|
-
res.push(base64_encode(saltb, saltb.length));
|
|
3032
|
-
res.push(base64_encode(bytes, C_ORIG.length * 4 - 1));
|
|
3033
|
-
return res.join("");
|
|
3034
|
-
}
|
|
3035
|
-
if (typeof callback == "undefined")
|
|
3036
|
-
return finish(_crypt(passwordb, saltb, rounds));
|
|
3037
|
-
else {
|
|
3038
|
-
_crypt(passwordb, saltb, rounds, function(err2, bytes) {
|
|
3039
|
-
if (err2)
|
|
3040
|
-
callback(err2, null);
|
|
3041
|
-
else
|
|
3042
|
-
callback(null, finish(bytes));
|
|
3043
|
-
}, progressCallback);
|
|
3044
|
-
}
|
|
3045
|
-
}
|
|
3046
|
-
bcrypt.encodeBase64 = base64_encode;
|
|
3047
|
-
bcrypt.decodeBase64 = base64_decode;
|
|
3048
|
-
return bcrypt;
|
|
3049
|
-
});
|
|
3050
|
-
});
|
|
3051
|
-
|
|
3052
1242
|
// src/key.ts
|
|
3053
|
-
var enc_utf8 = __toESM(require_enc_utf8(), 1);
|
|
3054
1243
|
var enc_base64 = __toESM(require_enc_base64(), 1);
|
|
1244
|
+
var enc_utf8 = __toESM(require_enc_utf8(), 1);
|
|
3055
1245
|
import {getRandomValues} from "crypto";
|
|
3056
1246
|
function generateAppKey() {
|
|
3057
1247
|
const random = getRandomValues(new Uint8Array(32));
|
|
@@ -3076,7 +1266,8 @@ var decrypt = function(encrypted) {
|
|
|
3076
1266
|
return aes.default.decrypt(encrypted, passphrase).toString(enc_utf82.default);
|
|
3077
1267
|
};
|
|
3078
1268
|
// src/hash.ts
|
|
3079
|
-
var
|
|
1269
|
+
var md5 = __toESM(require_md5(), 1);
|
|
1270
|
+
import {hashing} from "@stacksjs/config";
|
|
3080
1271
|
|
|
3081
1272
|
// ../../../../node_modules/js-base64/base64.mjs
|
|
3082
1273
|
var version = "3.7.7";
|
|
@@ -3234,16 +1425,18 @@ var gBase64 = {
|
|
|
3234
1425
|
};
|
|
3235
1426
|
|
|
3236
1427
|
// src/hash.ts
|
|
3237
|
-
|
|
3238
|
-
|
|
3239
|
-
|
|
3240
|
-
if (algorithm === "bcrypt")
|
|
1428
|
+
async function make(password, options) {
|
|
1429
|
+
if (options?.algorithm === "argon2")
|
|
1430
|
+
return argon2Encode(password, { type: "argon2id" });
|
|
1431
|
+
if (options?.algorithm === "bcrypt")
|
|
3241
1432
|
return bcryptEncode(password);
|
|
3242
|
-
if (algorithm === "base64")
|
|
1433
|
+
if (options?.algorithm === "base64")
|
|
3243
1434
|
return base64Encode(password);
|
|
3244
1435
|
throw new Error("Unsupported algorithm");
|
|
3245
1436
|
}
|
|
3246
1437
|
async function verify(password, hash, algorithm) {
|
|
1438
|
+
if (algorithm === "argon2")
|
|
1439
|
+
return argon2Verify(password, hash);
|
|
3247
1440
|
if (algorithm === "bcrypt")
|
|
3248
1441
|
return bcryptVerify(password, hash);
|
|
3249
1442
|
if (algorithm === "base64")
|
|
@@ -3253,22 +1446,37 @@ async function verify(password, hash, algorithm) {
|
|
|
3253
1446
|
async function bcryptEncode(password) {
|
|
3254
1447
|
if (!hashing.bcrypt)
|
|
3255
1448
|
throw new Error("Bcrypt hashing is not configured");
|
|
3256
|
-
const
|
|
3257
|
-
|
|
3258
|
-
|
|
1449
|
+
const bcryptHash = await Bun.password.hash(password, {
|
|
1450
|
+
algorithm: "bcrypt",
|
|
1451
|
+
cost: hashing.bcrypt.cost
|
|
1452
|
+
});
|
|
1453
|
+
return bcryptHash;
|
|
1454
|
+
}
|
|
1455
|
+
async function argon2Encode(password, options) {
|
|
1456
|
+
if (!hashing.argon2)
|
|
1457
|
+
throw new Error("Argon2 hashing is not configured");
|
|
1458
|
+
const argon2Hash = await Bun.password.hash(password, {
|
|
1459
|
+
algorithm: options?.type || "argon2id",
|
|
1460
|
+
memoryCost: hashing.argon2.memory,
|
|
1461
|
+
timeCost: hashing.argon2.time
|
|
1462
|
+
});
|
|
1463
|
+
return argon2Hash;
|
|
1464
|
+
}
|
|
1465
|
+
async function argon2Verify(password, hash) {
|
|
1466
|
+
return await Bun.password.verify(password, hash);
|
|
3259
1467
|
}
|
|
3260
1468
|
async function bcryptVerify(password, hash) {
|
|
3261
|
-
return await
|
|
1469
|
+
return await Bun.password.verify(password, hash);
|
|
3262
1470
|
}
|
|
3263
|
-
|
|
1471
|
+
function base64Encode(password) {
|
|
3264
1472
|
return gBase64.encode(password);
|
|
3265
|
-
}
|
|
3266
|
-
|
|
1473
|
+
}
|
|
1474
|
+
function base64Verify(password, hash) {
|
|
3267
1475
|
return gBase64.decode(hash) === password;
|
|
3268
|
-
}
|
|
3269
|
-
|
|
1476
|
+
}
|
|
1477
|
+
function md5Encode(password) {
|
|
3270
1478
|
return md5.default(password);
|
|
3271
|
-
}
|
|
1479
|
+
}
|
|
3272
1480
|
export {
|
|
3273
1481
|
verify as verifyHash,
|
|
3274
1482
|
md5Encode,
|
|
@@ -3279,5 +1487,7 @@ export {
|
|
|
3279
1487
|
bcryptVerify,
|
|
3280
1488
|
bcryptEncode,
|
|
3281
1489
|
base64Verify,
|
|
3282
|
-
base64Encode
|
|
1490
|
+
base64Encode,
|
|
1491
|
+
argon2Verify,
|
|
1492
|
+
argon2Encode
|
|
3283
1493
|
};
|