randomhex
Will generate a random HEX string of a specifc byte size.
Last updated 3 years ago by frozeman .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install randomhex 
SYNC missed versions from official npm registry.

randomHex

Will create a random bytes HEX string, in node.js and browsers with crypto.

This library uses the crypto.randomBytes() in node.js, and crypto.getRandomValues() in the browser.

Both of those random generators should provide cryptographically strong pseudo-random data.

$ npm install randomhex
var randomHex = require('randomhex');

randomHex(16); // get 16 random bytes as HEX string (0x + 32 chars)
> "0xd59e72dbf8612798aa1674834c80894e"

randomHex(32, console.log); // get 32 random bytes as HEX string (0x + 64 chars)
> null "0x409de75fc727d81a7d9f59580130ce3e76124679eb5c4647eb18c40512450c29"

Current Tags

  • 0.1.5                                ...           latest (3 years ago)

6 Versions

  • 0.1.5                                ...           3 years ago
  • 0.1.4                                ...           3 years ago
  • 0.1.3                                ...           3 years ago
  • 0.1.2                                ...           3 years ago
  • 0.1.1                                ...           3 years ago
  • 0.1.0                                ...           3 years ago

Copyright 2014 - 2016 © taobao.org |