Billy Verreynne wrote:Well, not done it myself before, but I would say that the moment you say "unique" you're talking of including some sort of sequence number, and then to make it pseudo-random, perhaps use some sort of hash or encryption with a little salt.
Any suggestions for an elegant way to generating nonces in PL/SQL code? It needs to be pseudo random and unique (over a 5 minute period for example).
E.g. timestamp pus random number as a base64 string. Or GUID (which is also time based).
padders wrote:Looks good to me.... sys_guid() providing the uniqueness and random tagged onto the end for randomness. That would pretty much ensure that no two values are the same.
Would it be overly simplistic to suggest something like...
sys_guid () || dbms_crypto.randombytes (n)