* @param $withFixed Whether to include a fixed salt (not recommended in p2p applications)
* @return $hashed The hashed and salted string
*/
- public function hashString ($str, $oldHash = '', $withFixed = true) {
- // Cast the string
- $str = (string) $str;
-
+ public function hashString (string $str, string $oldHash = '', bool $withFixed = true) {
// Default is the default salt ;-)
$salt = $this->salt;
* @param $key Optional key, if none provided, a random key will be generated
* @return $encrypted Encrypted string
*/
- public function encryptString ($str, $key = NULL) {
+ public function encryptString (string $str, string $key = NULL) {
// Encrypt the string through the stream
$encrypted = $this->cryptoStreamInstance->encryptStream($str, $key);
* @param $encrypted Encrypted string
* @return $str The unencrypted string
*/
- public function decryptString ($encrypted) {
+ public function decryptString (string $encrypted) {
// Encrypt the string through the stream
$str = $this->cryptoStreamInstance->decryptStream($encrypted);