note 130546 added to function.hash-algos

From: Date: Tue, 18 Nov 2025 09:32:31 +0000
Subject: note 130546 added to function.hash-algos
Groups: php.notes 
Request: Send a blank email to php-notes+get-222422@lists.php.net to get a copy of this message
I am using PHP 7.4.x on Ubuntu and was considering using the Argon2id hashing algorithm, so I checked if it was present via hash_algos(), but none of the Argon2 algos are listed. Note: The example output above from PHP 8.1.0 also does not list the Argon2 algos. I then spent some time checking for an Ubuntu php-argon2 package, but could not find one. On a whim, I tried just using Argon2id, even though it was not listed -- and it worked! Command: <?php print password_hash('password', PASSWORD_ARGON2ID); ?> Output: $argon2id$v=19$m=65536,t=4,p=1$bjBJbmhaNjVSTm90c3BYTA$fZtLEmXRLn4kF1UOV6OUBmsVwCWNizlwkUQhEd684N0 The description for hash_algos() says it lists all available algorithms, but it clearly does not. So be aware, and save yourself some time! ---- Server IP: 45.112.84.4 Probable Submitter: 45.112.84.18 (proxied: 38.13.79.164) ---- Manual Page -- https://php.net/manual/en/function.hash-algos.php Edit -- https://main.php.net/note/edit/130546 Del: integrated -- https://main.php.net/note/delete/130546/integrated Del: useless -- https://main.php.net/note/delete/130546/useless Del: bad code -- https://main.php.net/note/delete/130546/bad+code Del: spam -- https://main.php.net/note/delete/130546/spam Del: non-english -- https://main.php.net/note/delete/130546/non-english Del: in docs -- https://main.php.net/note/delete/130546/in+docs Del: other reasons-- https://main.php.net/note/delete/130546 Reject -- https://main.php.net/note/reject/130546 Search -- https://main.php.net/manage/user-notes.php

« previous php.notes (#222422) next »