Advertisement
Guest User

Untitled

a guest
Feb 9th, 2016
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.35 KB | None | 0 0
  1. var Hashids = require("hashids");
  2.  
  3. encode = function(string, salt, callback) {
  4. var hashids = new Hashids(decodeURIComponent(salt));
  5. var id = hashids.encode(parseInt(string));
  6. callback(id);
  7. }
  8.  
  9. decode = function(string, salt, callback) {
  10. var hashids = new Hashids(decodeURIComponent(salt));
  11. var numbers = hashids.decode(string);
  12. callback(numbers);
  13. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement