nodecommons-security
Advanced tools
Comparing version 1.1.0 to 1.2.0
@@ -6,2 +6,6 @@ /// <reference types="node" /> | ||
static sha256(data: string | Buffer): string; | ||
private static generateRandomData; | ||
static randomMd5(iterations?: number): string; | ||
static randomSha1(iterations?: number): string; | ||
static randomSha256(iterations?: number): string; | ||
} |
@@ -14,4 +14,22 @@ "use strict"; | ||
} | ||
static generateRandomData(iterations = 10000) { | ||
const rands = [new Date().getTime()]; | ||
for (let i = iterations; i-- > 0;) { | ||
rands.push(Math.random()); | ||
} | ||
return rands | ||
.map((rand) => rand.toString(36)) | ||
.join(''); | ||
} | ||
static randomMd5(iterations = 10000) { | ||
return CommonsHash.md5(CommonsHash.generateRandomData(iterations)); | ||
} | ||
static randomSha1(iterations = 10000) { | ||
return CommonsHash.sha1(CommonsHash.generateRandomData(iterations)); | ||
} | ||
static randomSha256(iterations = 10000) { | ||
return CommonsHash.sha256(CommonsHash.generateRandomData(iterations)); | ||
} | ||
} | ||
exports.CommonsHash = CommonsHash; | ||
//# sourceMappingURL=commons-hash.js.map |
export * from './helpers'; | ||
export * from './interfaces'; | ||
export * from './services'; |
@@ -8,2 +8,4 @@ "use strict"; | ||
__export(require("./helpers")); | ||
__export(require("./interfaces")); | ||
__export(require("./services")); | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "nodecommons-security", | ||
"version": "1.1.0", | ||
"version": "1.2.0", | ||
"description": "", | ||
@@ -13,3 +13,4 @@ "scripts": { | ||
"dependencies": { | ||
"@types/node": "^13.13.4" | ||
"@types/node": "^13.13.4", | ||
"tscommons-core": "^1.21.2" | ||
}, | ||
@@ -16,0 +17,0 @@ "files": [ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
13756
28
216
2
+ Addedtscommons-core@^1.21.2
+ Addedtscommons-core@1.33.1(transitive)