GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — RdRand/clients/node at master · JebteK/RdRand

Expand file tree

/

node

/
Copy path

Directory actions

More options

More options

Directory actions

More options

More options

Latest commit

 

History

History
History
/

node

/
Copy path

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
test
test
 
 
README.md
README.md
 
 
index.d.ts
index.d.ts
 
 
index.js
index.js
 
 
package.json
package.json
 
 

README.md

Outline

@jebtek/rdrand

Hardware random numbers for Node.js. The client uses your CPU's own hardware generator when it has one: RDRAND on Intel and AMD x86_64, RNDR on ARMv8.5+ such as AWS Graviton3 and Graviton4. Otherwise (and if the hardware ever fails to deliver) it calls the free rdrand.com API. No API key is needed. Results have the same formats either way.

Node.js 18 or later, no dependencies. The hardware path ships prebuilt for linux-x64, linux-arm64, win32-x64, darwin-x64 and darwin-arm64 (Apple silicon has no RNDR, so it uses the API).

Install

npm install https://rdrand.com/Downloads/jebtek-rdrand-2.0.0.tgz

Use

const { RdRand } = require('@jebtek/rdrand');   // or: import { RdRand } from '@jebtek/rdrand'

const rng = new RdRand();                  // mode 'auto'
const key = await rng.generateKey(32);     // 32 chars from 0-9 A-Z _ a-z
const bytes = await rng.generateBytes(16); // Buffer of 16 random bytes
const n = await rng.generateUInt();        // 0 .. 2^31 - 1

console.log(rng.source);                   // 'rdrand', 'rndr' or 'service'
console.log(RdRand.hardwareSource());      // the CPU's generator, or null

Options: new RdRand({ mode, baseUrl, timeoutMs }) with mode one of 'auto' (hardware, else API), 'hardware' (rejects with RdRandError without a hardware generator) or 'service' (API only).

License: MIT, Copyright © 2014-2026 JebteK, LLC.

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.