Closed iCyberon closed 7 years ago
@somebee Support for multiple numbers are definitely coming, I've already implemented and using it. I'll try to push the update ASAP (most probably within 12 hours). Regarding the custom alphabet, do you want to specify it every time you call the function or supply it once and use it later?
Hey @somebee, I just pushed an update which adds ability to encode multiple numbers. I'll update the readme soon.
Just pass an array instead of int to get the desired result. salt
, min_length
and alphabet
are optional. id_decode
will return BIGINT[]
. But if you would like to get just first number or if you're sure the hash contains only one number you can use id_decode_once
, which will return BIGINT
.
SELECT id_encode(ARRAY[1,2,3,20], 'hello', 20, 'abcdefghijABCDxFGHIJ1234567890');
SELECT id_decode('gjA34a5eI6C1hAba186D', 'hello', 20, 'abcdefghijABCDxFGHIJ1234567890');
SELECT id_decode_once('3GJ956J9B9', 'This is my salt', 10, 'abcdefghijABCDxFGHIJ1234567890');
Let me know if you have any questions :)
Great plugin :) Is encoder/decoder for multiple numbers coming? And is there any way to change the alphabet?