From c491e042bd113bda77440b9a7d9bce3bdfcc906d Mon Sep 17 00:00:00 2001 From: Joe Carstairs Date: Thu, 24 Sep 2026 08:44:48 +0100 Subject: move bcrypt to public/do/ --- http/bcrypt.php | 62 --------------------------------------------------------- 1 file changed, 62 deletions(-) delete mode 100644 http/bcrypt.php (limited to 'http/bcrypt.php') diff --git a/http/bcrypt.php b/http/bcrypt.php deleted file mode 100644 index 00eda33..0000000 --- a/http/bcrypt.php +++ /dev/null @@ -1,62 +0,0 @@ - 72) { - http_response_code(422); - header('Content-Type: text/plain; charset=utf-8'); - header('Cache-Control: no-store'); - echo 'password exceeds the 72-byte bcrypt limit'; - exit; -} - -$hash = password_hash($pass, PASSWORD_BCRYPT, ['cost' => BCRYPT_COST]); - -if ($hash === false) { - http_response_code(500); - header('Content-Type: text/plain; charset=utf-8'); - header('Cache-Control: no-store'); - echo 'hashing failed'; - exit; -} - -header('Content-Type: application/json; charset=utf-8'); -header('Cache-Control: no-store, no-cache, must-revalidate'); -header('Pragma: no-cache'); - -echo json_encode([ - 'user' => $user, - 'pass_hash' => $hash, - 'algo' => password_get_info($hash)['algoName'], - 'cost' => BCRYPT_COST, -], JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES), "\n"; -- cgit v1.2.3