Closed nikoz84 closed 7 years ago
Hey @nikoz84, could you please give me a sample?
Edit
I think the reason is that id_decode
returns Array
. You can use id_decode_once
to get just one item.
Example
SELECT id_decode_once('3GJ956J9B9', 'This is my salt', 10, 'abcdefghijABCDxFGHIJ1234567890');
Look this example
SELECT id_encode(1001); -- Result: jNl
SELECT id_decode('jNl'); -- Result: jNl
SELECT id_decode('0pMnYQxnR4', 'Pat20170831', 10);
You have a reason SELECT id_decode_once('0pMnYQxnR4', 'Pat20170831', 10);
the result was : 119
@nikoz84 I have not updated the readme yet.
id_decode
- returns array bigint[]
.
id_decode_once
- returns just one (first) number bigint
.
_P.S. If you're having trouble identifying which function does what you can refer to https://github.com/iCyberon/pg_hashids/blob/master/pg_hashids--1.2.sql file._
Let me know if you need anything else :)
Thank you for your time and your usefull extension...
Hi, thanks for your extension, its very usefull, i'm try to decode and the result its correct. But the return is between keys {15456}, the field is defined like a bigserial. You have any idea?