Moved password generation to the client #13

Merged
bookercodes merged 18 commits from master into master 2015-08-16 09:25:11 +00:00
2 changed files with 234 additions and 0 deletions
Showing only changes of commit 91fb2972b4 - Show all commits

View File

@ -1,5 +1,8 @@
var passwordGenerator = (function() {
var generateRandomNum = function (max) {
if (!window.crypto || !window.crypto.getRandomValues) {
throw new Error('Unsupported browser.');
}
var array = new Uint8Array(1);
window.crypto.getRandomValues(array);
var range = max + 1;