Permalink
Browse files

pass Mongoose `ObjectID` values into `encryptHex`

  • Loading branch information...
1 parent 59c8f5d commit 80604a9d3f4ef5ed1f818c11704d7954c09b5616 @namuol committed Nov 22, 2013
Showing with 1 addition and 1 deletion.
  1. +1 −1 lib/hashids.js
View
@@ -152,7 +152,7 @@ Hashids.prototype.encryptHex = function(str) {
return "";
}
- numbers = str.match(/[\w\W]{1,12}/g);
+ numbers = str.toString().match(/[\w\W]{1,12}/g);
for (i = 0, len = numbers.length; i !== len; i++) {
numbers[i] = parseInt("1" + numbers[i], 16);

0 comments on commit 80604a9

Please sign in to comment.