Version: v0.8.1 - Beta.  We welcome contributors & feedback.

Password.xDangerHash

$password.xDangerHash() -> string

Description

Return a one-way encrypted hash of the user’s password.

A hash can not be decrypted back into its original plaintext. It is compared with the hash of another password to see if they match.

This method currently uses the industry-standard bcrypt (Blowfish) hashing algorithm.

The Db module will automatically store passwords as their hash, so try to avoid dealing with hashes directly.

$tryPassword = Input.get('password')
$tryPassword.xDangerHash()

//= '$2y$10$uuUSTgIPIoluenI/4w0x...' (60 chars)