lundi 30 janvier 2017

Random identifiers: secure VS unique. What to chose?

Some times when we want to identify something we generate IDentifier for this object.

Sometimes we use just rand sometimes we want something more reliable. Currently I am between:

  1. Data::UUID
  2. Crypt::PRNG

Would be there any difference between results of these two methods?

$id = Data::UUID->new->create_bin;    #
$id = Crypt::PRNG::random_bytes(16);  # http://ift.tt/2jv4oou

Both are 16bytes random. Regardless of interface are there further differences?




Aucun commentaire:

Enregistrer un commentaire