Any reliable uuid package from Packagist that I can download and use it for Slim framework?
Ideally,I would an uuid that I can hash a type, e.g. php, into the string. then i can check if that uuid has 'php'.
EDIT:
How can I validate a name-based hashed has the name that we assign it to the uuid?
// Generate a version 3 (name-based and hashed with MD5) UUID object
$uuid3 = Uuid::uuid3(Uuid::NAMESPACE_DNS, 'php.net');
$uuid = $uuid3->toString();
For instance:
if ($uuid3->getName($uuid) === 'php.net') {
// do something
}
Is this possible?
The best UUID package is https://github.com/ramsey/uuid
Just use
composer require ramsey/uuid
to install it.I don't understand this. UUIDs create a unique string. From Wikipedia:
Edit.
To answer your new question…
You can't reverse a hash, so you need to hash again and compare.