Permalink
Browse files

Merge pull request #56 from deltasquare4/master

Fixed incorrect sid base64 to number calculation
  • Loading branch information...
2 parents a464a95 + 964397e commit 931c80f63f0b42f2be1944f636f3073448477e1a @rauchg rauchg committed Oct 4, 2012
Showing with 2 additions and 3 deletions.
  1. +2 −3 lib/up.js
View
@@ -1,4 +1,3 @@
-
/**
* Module dependencies.
*/
@@ -263,8 +262,8 @@ UpServer.prototype.defaultWS = function (req, res, next) {
var result = 0;
sid = sid.split('');
- for(var index in glyphs) {
- result = (result * 64) + glyphs.indexOf(glyphs[index]);
+ for(var index = sid.length - 1; index >= 0; index--) {
+ result = (result * 64) + glyphs.indexOf(sid[index]);
}
sid = result;
}

0 comments on commit 931c80f

Please sign in to comment.