Permalink
Browse files

Merge pull request #16 from abovethewater/master

Issue #15.  Missing mongodb dependency for testing
  • Loading branch information...
2 parents 79b3cca + ca0526e commit c2a5e65c0de968c7d4170a25ecefc467737a5f4e @lancejpollard lancejpollard committed Mar 1, 2012
Showing with 8 additions and 4 deletions.
  1. +2 −1 lib/tower/generator/resources.js
  2. +4 −2 package.json
  3. +2 −1 src/tower/generator/resources.coffee
@@ -145,8 +145,9 @@ Tower.Generator.Resources = {
var crypto, hash;
if (code == null) code = "hex";
crypto = require('crypto');
+ uuid = require('node-uuid');
hash = crypto.createHash("sha1");
- hash.update(crypto.randomBytes(64).toString());
+ hash.update(uuid.v4());
return hash.digest(code);
},
buildUser: function(callback) {
View
@@ -60,7 +60,8 @@
"restler": ">= 0.0.1",
"useragent": ">= 1.0.5",
"URIjs": ">= 1.4.2",
- "moment": ">= 1.4.0"
+ "moment": ">= 1.4.0",
+ "node-uuid": ">= 1.3.0"
},
"devDependencies": {
"coffee-script": ">= 1.2.0",
@@ -71,7 +72,8 @@
"chai": ">= 0.3.3",
"sinon": ">= 1.3.1",
"gzip": ">= 0.1.0",
- "forever": ">= 0.8.5"
+ "forever": ">= 0.8.5",
+ "mongodb": ">= 0.9.9"
},
"scripts": {
"test": "mocha $(find test -name \"*Test.coffee\") -r coffee-script $@"
@@ -103,8 +103,9 @@ Tower.Generator.Resources =
generateRandom: (code = "hex") ->
crypto = require('crypto')
+ uuid = require('node-uuid')
hash = crypto.createHash("sha1")
- hash.update(crypto.randomBytes(64).toString())
+ hash.update(uuid.v4())
hash.digest(code)
buildUser: (callback) ->

0 comments on commit c2a5e65

Please sign in to comment.