@stablelib/random
Advanced tools
Comparing version 0.7.4 to 1.0.0
@@ -0,1 +1,5 @@ | ||
/** | ||
* Package random provides functions to access system's | ||
* cryptographically secure random byte generator. | ||
*/ | ||
import { RandomSource } from "./source"; | ||
@@ -6,5 +10,8 @@ import { SystemRandomSource } from "./source/system"; | ||
export declare function randomBytes(length: number, prng?: RandomSource): Uint8Array; | ||
/** | ||
* Returns a uniformly random unsigned 32-bit integer. | ||
*/ | ||
export declare function randomUint32(prng?: RandomSource): number; | ||
/** | ||
* Returns uniform random string of the given length | ||
* Returns a uniform random string of the given length | ||
* with characters from the given charset. | ||
@@ -11,0 +18,0 @@ * |
@@ -14,2 +14,5 @@ "use strict"; | ||
exports.randomBytes = randomBytes; | ||
/** | ||
* Returns a uniformly random unsigned 32-bit integer. | ||
*/ | ||
function randomUint32(prng) { | ||
@@ -31,3 +34,3 @@ if (prng === void 0) { prng = exports.defaultRandomSource; } | ||
/** | ||
* Returns uniform random string of the given length | ||
* Returns a uniform random string of the given length | ||
* with characters from the given charset. | ||
@@ -34,0 +37,0 @@ * |
@@ -8,5 +8,5 @@ export interface RandomSource { | ||
/** | ||
* Fill out with random bytes and return it. | ||
* Returns a byte array of the given length filled with random bytes. | ||
*/ | ||
randomBytes(length: number): Uint8Array; | ||
} |
{ | ||
"name": "@stablelib/random", | ||
"version": "0.7.4", | ||
"version": "1.0.0", | ||
"description": "Cryptographically-secure pseudorandom number generator", | ||
@@ -17,8 +17,8 @@ "main": "./lib/random.js", | ||
"dependencies": { | ||
"@stablelib/binary": "^0.7.2", | ||
"@stablelib/wipe": "^0.5.0" | ||
"@stablelib/binary": "^1.0.0", | ||
"@stablelib/wipe": "^1.0.0" | ||
}, | ||
"devDependencies": { | ||
"@stablelib/benchmark": "^0.5.0", | ||
"@stablelib/hex": "^0.5.0" | ||
"@stablelib/benchmark": "^1.0.0", | ||
"@stablelib/hex": "^1.0.0" | ||
}, | ||
@@ -28,3 +28,3 @@ "react-native": { | ||
}, | ||
"gitHead": "cd823c5ca890d18b9abd28aae7af728013e7ef9b" | ||
"gitHead": "c3b9e138650642a738a9225956c75dbe44c76ae6" | ||
} |
// Copyright (C) 2016 Dmitry Chestnykh | ||
// MIT License. See LICENSE file for details. | ||
/** | ||
* Package random provides functions to access system's | ||
* cryptographically secure random byte generator. | ||
*/ | ||
import { RandomSource } from "./source"; | ||
@@ -17,2 +22,5 @@ import { SystemRandomSource } from "./source/system"; | ||
/** | ||
* Returns a uniformly random unsigned 32-bit integer. | ||
*/ | ||
export function randomUint32(prng: RandomSource = defaultRandomSource): number { | ||
@@ -37,3 +45,3 @@ // Generate 4-byte random buffer. | ||
/** | ||
* Returns uniform random string of the given length | ||
* Returns a uniform random string of the given length | ||
* with characters from the given charset. | ||
@@ -40,0 +48,0 @@ * |
@@ -13,5 +13,5 @@ // Copyright (C) 2016 Dmitry Chestnykh | ||
/** | ||
* Fill out with random bytes and return it. | ||
* Returns a byte array of the given length filled with random bytes. | ||
*/ | ||
randomBytes(length: number): Uint8Array; | ||
} |
Sorry, the diff of this file is not supported yet
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
33808
654
1
+ Added@stablelib/binary@1.0.1(transitive)
+ Added@stablelib/int@1.0.1(transitive)
+ Added@stablelib/wipe@1.0.1(transitive)
- Removed@stablelib/binary@0.7.2(transitive)
- Removed@stablelib/int@0.5.0(transitive)
- Removed@stablelib/wipe@0.5.0(transitive)
Updated@stablelib/binary@^1.0.0
Updated@stablelib/wipe@^1.0.0