2.7 KiB
danog\MadelineProto\MTProtoTools\PasswordCalculator
Author: Daniil Gentili daniil@daniil.it
Manages SRP password calculation.
Method list:
addInfo(array $object): void
createSalt(string $prefix): \string Salt
hashSha256(string $data, string $salt): \string Hash
hashPassword(string $password, string $client_salt, string $server_salt): \string Resulting hash
getCheckPassword(string $password): \array InputCheckPassword object
getPassword(array $params): \array account.updatePasswordSettings parameters
Methods:
addInfo(array $object): void
Popupate 2FA configuration.
Parameters:
$object
:array
2FA configuration object obtained using account.getPassword
Generated by danog/phpdoc
createSalt(string $prefix): \string Salt
Create a random string (eventually prefixed by the specified string).
Parameters:
$prefix
:string
Prefix
Return value: Salt
Generated by danog/phpdoc
hashSha256(string $data, string $salt): \string Hash
Hash specified data using the salt with SHA256. The result will be the SHA256 hash of the salt concatenated with the data concatenated with the salt
Parameters:
$data
:string
Data to hash$salt
:string
Salt
Return value: Hash
Generated by danog/phpdoc
hashPassword(string $password, string $client_salt, string $server_salt): \string Resulting hash
Hashes the specified password.
Parameters:
$password
:string
Password$client_salt
:string
Client salt$server_salt
:string
Server salt
Return value: Resulting hash
Generated by danog/phpdoc
getCheckPassword(string $password): \array InputCheckPassword object
Get the InputCheckPassword object for checking the validity of a password using account.checkPassword.
Parameters:
$password
:string
The password
Return value: InputCheckPassword object
Generated by danog/phpdoc
getPassword(array $params): \array account.updatePasswordSettings parameters
Get parameters to be passed to the account.updatePasswordSettings to update/set a 2FA password. The input params array can contain password, new_password, email and hint params.
Parameters:
$params
:array
Input params
Return value: account.updatePasswordSettings parameters
Generated by danog/phpdoc
Generated by danog/phpdoc