Created
May 7, 2010 17:05
-
-
Save dshaw/393718 to your computer and use it in GitHub Desktop.
uuid.js
This file contains hidden or 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
// From: http://github.com/wuher/oauth2/blob/master/lib/oauth2.js | |
/* | |
* implementation copied from narwhal/lib/uuid.js | |
* this is because narwhal/engines/rhino/lib/uuid.js overrides this | |
*/ | |
var CHARS = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'.split(''); | |
var generate_verifier = function (length, radix) { | |
var chars = CHARS, uuid = [], rnd = Math.random; | |
length = length || 8; | |
radix = radix || chars.length; | |
for (var i = 0; i < length; i++) uuid[i] = chars[0 | rnd()*radix]; | |
return uuid.join(''); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment