Socket
Socket
Sign inDemoInstall

@stablelib/random

Package Overview
Dependencies
3
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.7.4 to 1.0.0

9

lib/random.d.ts

@@ -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 @@ *

5

lib/random.js

@@ -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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc