LnxUser::getPassHash

Innen: IT documentation
A lap korábbi változatát látod, amilyen Moszat (vitalap | szerkesztései) 2021. szeptember 21., 20:34-kor történt szerkesztése után volt. (→‎Changelog)

Description

Object-oriented style

public lnxUser::getPassHash ( string $password, string $salt = '', string $hash = '' ): string

Procedural style

lnxGetPassHash ( string $password, string $salt = '', string $hash = '' ): string

Creates a password hash.

MD5, SHA-256, SHA-512 password hash methods are implemented.

Parameters

password
Password string.
salt
Password salt. Must be alphanumeric and between 8 and 16 characters for SHA256 and SHA512 and between 4 and 5 characters for MD5.
If empty salt will be generated.
hash
Hash algorithm type. Use LNX_PH family of constants.
If empty will be used the default hash method.

Return Values

Returns a hashed password or empty if an error occurred.

Changelog

Version
(lnxUser)
Description
1.1 remove mkpassword dependency, add default hash handle
1.00 available

Examples

$hash = lnxGetPassHash ( 'HelloNSA' );

print( "Password hash is $hash." . PHP_EOL );