secure-random
A simple JavaScript component to normalize the creation of cryptographically strong random values.
Why?
Context switching between the browser and Node.js and creating cryptographically secure random numbers is annoying. This normalizes the behavior. Used by cryptocoinjs
Install
Node.js/Browserify
npm install --save secure-random
Component
component install jprichardson/secure-random
Bower
bower install secure-random
Script
<script src="/path/to/secure-random.js"></script>
Usage
secureRandom(count, options)
count: is the number of elements to return.
options: options to pass. Only valid value is array
.
Returns a Uint8Array
or Array
if options.array
is set.
var bytes = secureRandom(10)
console.log(bytes.length)
References
License
(MIT License)
Copyright 2013, JP Richardson