npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

rdrand

v0.0.1

Published

A package wrapping the Intel RDRAND hardware random number generator instructino

Readme

rdrand

node.js module providing support for the Intel Ivy Bridge (and later) RDRAND instruction.

This is a work in progress!

Intel Ivy Bridge/2nd generation and later Core processors have a hardware random number generator that is compliant with various crypto standards. This module provides a wrapper around functions to access the RDRAND instruction to get hardware generated cryptographically secure (per Intel) random numbers.

WARNING: I am not a crypto expert. I just implemented the functions. For more info on RDRAND and the hardware random number generator, google 'intel RDRAND'.

platforms tested

  • Ubuntu Linux 13.x, x64 : npm install works and executes properly the RDRAND instruction is supported in the 32 bit mode of the processor, however 32 bit builds are not yet implemented here
  • Windows 8 with Visual Studio 2012 : works but requires manual install. see w/readme.txt

resources used

  • RDRAND64 : Author: Stephen Higgins [email protected] Blog: http://blog.viathefalcon.net/
  • Intel RDRAND library : http://software.intel.com/en-us/articles/intel-digital-random-number-generator-drng-software-implementation-guide

license

  • MIT license with the exception u/rdrand.c - Intel specific license (freely reusable)

API

function hasRdrand() : returns a boolean indicating if the processor supports the RDRAND instruction
// true if it does, false if it doesn't
// be sure to call this first because if you call one of the following functions on a processor
// that doesn't support RDRAND, you will be a segfault for an illegal instruction.
// That is by design. If you need a fallback alternative, build that on top of this module.

function rdrand32() : returns a 32 bit random number as a whole number , type Number

function rdrand53() : returns a 53 bit random number as a whole number , type Number 
// why a 53 bit value? because a Number is a 64 bit float and it has 53 bits of precision.
// any value larger than what fits in 53 bits will be an approximation which is not what you want here.
// if you want a full 64 bits, use rdrand64b or rdrand64s
// I'm not even sure if this is useful. 

function rdrand64b() : returns an array of 8 bytes comprising the full 64 bit random value

function rdrand64s() : returns a string of up to 20 digits comprising the full 64 bit random value