public static function compare($hash1, $hash2): bool {
        if(!is_string($hash1)) {
            $hash1 = (string) $hash1;
        }
        if(!is_string($hash2)) {
            $hash2 = (string) $hash2;
        }
        return hash_equals($hash1, $hash2);
    }