markbao/speakeasy — pull request #28 by aw (2014-08-11 11:50:32+00:00)
Title: Better random string generatation

I'm a bit worried about Speakeasy's method of generating a random secret key.

**Node.JS** ships with a great library for handling that.

Here are the changes I've included:

* New function called `generate_key_hex()` which uses `crypto.randomBytes()` to create a truly random string
* Modified `generate_key()` to use `generate_key_hex()` instead of `generate_key_ascii()`
* The length parameter is now relevant for the _hex_ key instead of _ascii_
* The symbols option still exists, but it's basically unused (which makes this change API-compatible)
* Removed some unused functions
* Updated the dependency version of **thirty-two** because it now returns a buffer instead of a string.

The only caveat so far is it's now impossible to have an _ascii_ key with symbols (alphanumeric only).