mirror of
https://github.com/hotspotbilling/phpnuxbill.git
synced 2024-11-10 17:26:48 +08:00
35 lines
825 B
PHP
35 lines
825 B
PHP
<?php
|
|
|
|
/**
|
|
* PHP Mikrotik Billing (https://github.com/hotspotbilling/phpnuxbill/)
|
|
* by https://t.me/ibnux
|
|
**/
|
|
|
|
class Password
|
|
{
|
|
|
|
public static function _crypt($password)
|
|
{
|
|
return sha1($password);
|
|
}
|
|
|
|
public static function _verify($user_input, $hashed_password)
|
|
{
|
|
if (sha1($user_input) == $hashed_password) {
|
|
return true;
|
|
}
|
|
return false;
|
|
}
|
|
public static function _uverify($user_input, $hashed_password)
|
|
{
|
|
if ($user_input == $hashed_password) {
|
|
return true;
|
|
}
|
|
return false;
|
|
}
|
|
public static function _gen()
|
|
{
|
|
$pass = substr(str_shuffle(str_repeat('ABCDEFGHIJKLMNPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz@#!123456789', 8)), 0, 8);
|
|
return $pass;
|
|
}
|
|
}
|