The hashing component is used to hash strings and verify hashed string.

You find it used mostly used for comparing a plain password with the hashed version from a data store.

The easiest way to use the Hasher is to access to it through the service container $container->get('hasher').

Other wise just add the following parameter to the construct method of your Controller Tomahawk\Hashing\HasherInterface and it will get injected in through the Service Container.

Hashing a string

To hash a string you would do the following:

Validating a hashed string with original

To check a hashed string with the original string you would do the following: