Module pwhash::unix_crypt [] [src]

Seventh Edition Unix DES-based hash.

The original Unix password-hashing algorithm, extremely weak by today's standards. It should be used for backward compatibility only.

Example

use pwhash::unix_crypt;

assert_eq!(unix_crypt::hash_with("xO",
    "password").unwrap(), "xOAFZqRz5RduI");
assert_eq!(unix_crypt::verify("password","xOAFZqRz5RduI"),
    true);
     

Parameters

Hash Format

The format of the hash is {salt}{checksum}, where:

Constants

SALT_LEN

Salt length.

Functions

hash [
Deprecated
]

Hash a password with a randomly generated salt.

hash_with [
Deprecated
]

Hash a password with a user-provided salt.

verify

Verify that the hash corresponds to a password.