Created
May 15, 2015 00:34
-
-
Save cbanowsky/4b702076b274240e2eab to your computer and use it in GitHub Desktop.
Implemented this variation in a project today, and it was interesting
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
createCode: function (amount, currency, password) { | |
var deferred = $q.defer(); | |
var self = this; | |
var id = ""; | |
var possible = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; | |
for( var i=0; i < 8; i++ ) | |
id += possible.charAt(Math.floor(Math.random() * possible.length)); | |
if (!password || password == '') | |
password = id; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment