Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:20183 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 319 invoked by uid 1010); 19 Nov 2005 20:33:07 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 304 invoked from network); 19 Nov 2005 20:33:07 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 19 Nov 2005 20:33:07 -0000 X-Host-Fingerprint: 69.12.155.130 69-12-155-130.dsl.static.sonic.net Linux 2.4/2.6 Received: from ([69.12.155.130:1314] helo=pigeon.alphaweb.net) by pb1.pair.com (ecelerity 2.0 beta r(6323M)) with SMTP id 8C/A4-11378-20C8F734 for ; Sat, 19 Nov 2005 15:33:06 -0500 Received: from localhost ([127.0.0.1] helo=stumpy) by pigeon.alphaweb.net with smtp (Exim 4.10) id 1EdYc9-0006js-00; Sat, 19 Nov 2005 11:43:09 -0800 Message-ID: <006101c5ed48$cb62b880$7d051fac@stumpy> To: "Markus Fischer" Cc: References: <000701c5ec5f$33e2ff90$7d051fac@stumpy> <437F411C.7060801@fischer.name> Date: Sat, 19 Nov 2005 12:35:34 -0800 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=response Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.2180 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180 Subject: Re: [PHP-DEV] sha256(), sha256_file(), and other hashing algos From: pollita@php.net ("Sara Golemon") > I'm missing the functionality to get a list of registered hash functions > so one can probe whether a certain hash function is available or not. > There is now :) array hash_algos(void) Returns numerically indexed array of hashing engine names. And just incase anyone missed it. The proto for hash_init() has been extended: resource hash_init(string algo[, int options, string key]) Options currently has one possible value: HASH_HMAC When specified, key must be specified as well (to be used for the HMAC key). HMAC can be used with any of the hashing algos included in ext/hash. Examples of using HMAC with official test vectors can be found in tests/hmac-md5.phpt I'd rather not complicate the proto for the core hash() function with HMAC and other options, but maybe a separate hash_hmac() and/or hash_hmac_file() might be in order? -Sara