123456789101112131415161718192021222324252627282930313233343536373839404142434445 |
- <?php namespace System;
- class Hash {
-
- public static function make($value, $rounds = 10)
- {
- return static::hasher($rounds)->HashPassword($value);
- }
-
- public static function check($value, $hash)
- {
- return static::hasher()->CheckPassword($value, $hash);
- }
-
- private static function hasher($rounds = 10)
- {
- require_once SYS_PATH.'vendor/phpass'.EXT;
- return new \PasswordHash($rounds, false);
- }
- }
|