Map characters directly instead of using base64 and then manipulating the result
Use pseudoRandomBytes, which maps to OpenSSL's RAND_pseudo_bytes which for uid generation is fine
Merge pull request #2 from pquerna/character_mapping

Improve Character Mapping and use pseudoRandomBytes