New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@rahulv.dev/rng

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@rahulv.dev/rng - npm Package Compare versions

Comparing version 1.2.0 to 1.2.1

11

dist/index.js

@@ -17,2 +17,13 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
exports.RNG = void 0;
__exportStar(require("./interfaces/IRNG"), exports);
const rng_browser_1 = require("./rng.browser");
const rng_node_1 = require("./rng.node");
let RNGClass;
if (typeof window !== "undefined" && window.crypto) {
RNGClass = rng_browser_1.RNG;
}
else {
RNGClass = rng_node_1.RNG;
}
exports.RNG = RNGClass;

2

package.json
{
"name": "@rahulv.dev/rng",
"version": "1.2.0",
"version": "1.2.1",
"description": "A secure random number generator.",

@@ -5,0 +5,0 @@ "main": "dist/rng.node.js",

@@ -37,5 +37,2 @@ # @rahulv.dev/rng

import { RNG } from "@rahulv.dev/rng";
// For browser environment
import { RNG } from "@rahulv.dev/rng/browser";
```

@@ -84,8 +81,8 @@

Here’s a detailed look at the API methods provided by `@rahulv.dev/rng` and `@rahulv.dev/rng/browser`:
Here’s a detailed look at the API methods provided by `@rahulv.dev/rng`:
| Method | Description | Parameters | Returns |
| ------------------- | ------------------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------- |
| `next(upperLimit)` | Generates a secure random number between `0` and `upperLimit - 1`. | `upperLimit: number`: The upper limit for the random number (exclusive) | `Promise<number>`: A random number within the specified range. |
| `nextRange(ranges)` | Generates random numbers for an array of upper limits. | `ranges: number[]`: An array of upper limits. Each element specifies the exclusive upper limit for the corresponding random number. | `Promise<number[]>`: An array of random numbers, each within the range specified by the corresponding element in the input array. |
| Method | Description | Parameters | Returns |
| ------------------- | ------------------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------ |
| `next(upperLimit)` | Generates a secure random number between `0` and `upperLimit - 1`. | `upperLimit: number`: The upper limit for the random number (exclusive) | `number`: A random number within the specified range. |
| `nextRange(ranges)` | Generates random numbers for an array of upper limits. | `ranges: number[]`: An array of upper limits. Each element specifies the exclusive upper limit for the corresponding random number. | `number[]`: An array of random numbers, each within the range specified by the corresponding element in the input array. |

@@ -92,0 +89,0 @@ ### Usage Examples

export * from "./interfaces/IRNG";
import { RNG as RngBrowser } from "./rng.browser";
export declare const RNG: typeof RngBrowser;
SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc