„LnxUser::getPassHash” változatai közötti eltérés
Innen: IT documentation
Nincs szerkesztési összefoglaló |
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 = LNX_PH_SHA512 ): string | |||
</syntaxhighlight>Procedural style<syntaxhighlight lang="php"> | </syntaxhighlight>Procedural style<syntaxhighlight lang="php"> | ||
lnxGetPassHash ( string $password, string $salt = '', string $hash = LNX_PH_SHA512 ): string | |||
</syntaxhighlight> | </syntaxhighlight> | ||
Creates a password hash. | |||
== Parameters == | == Parameters == | ||
; password | |||
: Password string. | |||
; salt | |||
: Password salt. Must be alphanumeric and between 8 and 16 characters. | |||
; hash | |||
: Hash algorithm type. Use [[LnxUser PHP Class Reference#Constants|LNX_PH family of constants]]. | |||
== Return Values == | == Return Values == | ||
Returns a '''hashed password''' or '''empty''' if an error occurred. | |||
== Changelog == | == Changelog == | ||
{| class="wikitable" | {| class="wikitable" | ||
| 24. sor: | 30. sor: | ||
== Examples == | == Examples == | ||
<syntaxhighlight lang="php"> | <syntaxhighlight lang="php"> | ||
$ | $hash = lnxGetPassHash ( 'HelloNSA' ); | ||
$ | |||
print( "Password hash is $hash." . PHP_EOL ); | |||
</syntaxhighlight> | </syntaxhighlight> | ||
[[Kategória:LnxUser]] | [[Kategória:LnxUser]] | ||
A lap 2021. szeptember 19., 16:25-kori változata
Description
Object-oriented style
public lnxUser::getPassHash ( string $password, string $salt = '', string $hash = LNX_PH_SHA512 ): string
Procedural style
lnxGetPassHash ( string $password, string $salt = '', string $hash = LNX_PH_SHA512 ): string
Creates a password hash.
Parameters
- password
- Password string.
- salt
- Password salt. Must be alphanumeric and between 8 and 16 characters.
- hash
- Hash algorithm type. Use LNX_PH family of constants.
Return Values
Returns a hashed password or empty if an error occurred.
Changelog
| Version (lnxUser) |
Description |
|---|---|
| 1.00 | available |
Examples
$hash = lnxGetPassHash ( 'HelloNSA' );
print( "Password hash is $hash." . PHP_EOL );