diff --git a/src/bb-library/Box/Password.php b/src/bb-library/Box/Password.php new file mode 100644 index 000000000..1eaa3a9d4 --- /dev/null +++ b/src/bb-library/Box/Password.php @@ -0,0 +1,42 @@ +algo = $algo; + } + + public function setOptions($options = array()) + { + $this->options = $options; + } + + public function hashIt($password) + { + return password_hash($password, $this->algo, $this->options); + } + + public function verify ($password, $hash) + { + return password_verify((string) $password, $hash); + } + + public function needsRehash($hash) + { + return password_needs_rehash($hash, $this->algo, $this->options); + } +} \ No newline at end of file