„LnxUser::getPassHash” változatai közötti eltérés
Innen: IT documentation
Nincs szerkesztési összefoglaló |
|||
| 1. sor: | 1. sor: | ||
== Description == | == Description == | ||
Object-oriented style<syntaxhighlight lang="php"> | Object-oriented style<syntaxhighlight lang="php"> | ||
public lnxUser::getPassHash ( string $password, string $salt = '', string $hash = | public lnxUser::getPassHash ( string $password, string $salt = '', string $hash = '' ): string | ||
</syntaxhighlight>Procedural style<syntaxhighlight lang="php"> | </syntaxhighlight>Procedural style<syntaxhighlight lang="php"> | ||
lnxGetPassHash ( string $password, string $salt = '', string $hash = | lnxGetPassHash ( string $password, string $salt = '', string $hash = '' ): string | ||
</syntaxhighlight> | </syntaxhighlight> | ||
| 12. sor: | 12. sor: | ||
: Password string. | : Password string. | ||
; salt | ; salt | ||
: Password salt. Must be alphanumeric and between 8 and 16 characters. | : 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 | ||
: Hash algorithm type. Use [[LnxUser PHP Class Reference#Constants|LNX_PH family of constants]]. | : Hash algorithm type. Use [[LnxUser PHP Class Reference#Constants|LNX_PH family of constants]]. | ||
: If empty will be used the default hash method. | |||
== Return Values == | == Return Values == | ||
| 23. sor: | 25. sor: | ||
!Version<br>(lnxUser) | !Version<br>(lnxUser) | ||
!Description | !Description | ||
|- | |||
|1.1 | |||
|remove mkpassord dependency, add default hash handle | |||
|- | |- | ||
|1.00 | |1.00 | ||
A lap 2021. szeptember 21., 20:00-kori változata
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.
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 mkpassord dependency, add default hash handle |
| 1.00 | available |
Examples
$hash = lnxGetPassHash ( 'HelloNSA' );
print( "Password hash is $hash." . PHP_EOL );