cgserver 12.2.4 → 12.2.5
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/README.md
CHANGED
|
@@ -369,29 +369,17 @@ class core {
|
|
|
369
369
|
newStr += last;
|
|
370
370
|
return newStr;
|
|
371
371
|
}
|
|
372
|
-
static
|
|
373
|
-
let
|
|
372
|
+
static hash(algorithm, str, inputEncoding = null, encoding = "hex") {
|
|
373
|
+
let _hash = crypto.createHash(algorithm);
|
|
374
374
|
let hash = null;
|
|
375
375
|
if (inputEncoding) {
|
|
376
|
-
hash =
|
|
376
|
+
hash = _hash.update(str, inputEncoding);
|
|
377
377
|
}
|
|
378
378
|
else {
|
|
379
|
-
hash =
|
|
379
|
+
hash = _hash.update(str);
|
|
380
380
|
}
|
|
381
|
-
let
|
|
382
|
-
return
|
|
383
|
-
}
|
|
384
|
-
static sha1(str, inputEncoding = null, encoding = "hex") {
|
|
385
|
-
let _sha1 = crypto.createHash('sha1');
|
|
386
|
-
let hash = null;
|
|
387
|
-
if (inputEncoding) {
|
|
388
|
-
hash = _sha1.update(str, inputEncoding);
|
|
389
|
-
}
|
|
390
|
-
else {
|
|
391
|
-
hash = _sha1.update(str);
|
|
392
|
-
}
|
|
393
|
-
let sha1_str = hash.digest(encoding);
|
|
394
|
-
return sha1_str;
|
|
381
|
+
let hash_str = hash.digest(encoding);
|
|
382
|
+
return hash_str;
|
|
395
383
|
}
|
|
396
384
|
static getLocalIP = function () {
|
|
397
385
|
let iptable = {};
|
|
@@ -42,8 +42,7 @@ export declare class core {
|
|
|
42
42
|
* @param str
|
|
43
43
|
*/
|
|
44
44
|
static fuzzy(str: string): string;
|
|
45
|
-
static
|
|
46
|
-
static sha1(str: string, inputEncoding?: crypto.Encoding, encoding?: crypto.BinaryToTextEncoding): string;
|
|
45
|
+
static hash(algorithm: string, str: string, inputEncoding?: crypto.Encoding, encoding?: crypto.BinaryToTextEncoding): string;
|
|
47
46
|
static getLocalIP: () => any;
|
|
48
47
|
static getIP: () => Promise<string>;
|
|
49
48
|
/**
|