Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- SmallHash = {
- encode: function (input, ranges, base)
- var result = 0
- for offset = ranges.length - 1 downto 0
- result = result * ranges[input[offset]]
- result = result + input[offset];
- return int2str(result, base)
- },
- decode: function (input, ranges, base) {
- input = str2int(input, base)
- var result = [];
- for offset = 0 to ranges - 1
- result[offset] = inputs % ranges[offset]
- inputs = inputs / ranges[offset]
- return result;
- }
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement