3v4l.org

run code in 300+ PHP versions simultaneously
<?php $key = "algjhsdiouahwergoiuawhgiouaehnrgzdfgb23523"; $hash_function = "sha256"; $i = 0; $found = []; while (count($found) < 2) { $pw = base64_encode(str_repeat($i, 5)); $hash = hash_hmac($hash_function, $pw, $key); if ($hash[0] === "\0") { $found[] = $pw; } $i++; } var_dump($i, $found);

preferences:
51.62 ms | 402 KiB | 5 Q