Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var Hashids = require("hashids");
- encode = function(string, salt, callback) {
- var hashids = new Hashids(decodeURIComponent(salt));
- var id = hashids.encode(parseInt(string));
- callback(id);
- }
- decode = function(string, salt, callback) {
- var hashids = new Hashids(decodeURIComponent(salt));
- var numbers = hashids.decode(string);
- callback(numbers);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement