48 return (function_exists(
'sha1') || function_exists(
'mhash'));
59 public function generate_hash (
string $pwd,
bool $locked = FALSE): string
61 if (function_exists(
'sha1')) {
62 $hash =
'{SHA}'.($locked ?
'!' :
'').base64_encode(pack(
'H*', sha1($pwd)));
63 } elseif (function_exists(
'mhash')) {
64 $hash =
'{SHA}'.($locked ?
'!' :
'').base64_encode(mHash(MHASH_SHA1, $pwd));
generate_hash(string $pwd, bool $locked=FALSE)
Generate template hash.
is_available()
Is available.
This class contains all the functions for sha password method.
static get_hash_name()
Get the hash name.
Parent class for all exceptions thrown in FusionDirectory.
static missingext($name)
Display about missing PHP extension.
This class contains all the basic function for password methods.
__construct()
passwordMethodSha Constructor