public static function SSHA($password, $salt=null) {
		if(empty($salt)) {
			if(function_exists('openssl_random_pseudo_bytes')) {
				// salts should be four bytes
				$salt = bin2hex(openssl_random_pseudo_bytes(4));
			}
			else
			{
				throw new Exception(
					"You must have the openssl extension installed and enabled to use a random salt"
				);
			}
		}
		return "{SSHA}" . base64_encode(sha1($password . $salt, true) . $salt);
	}