Re: sha256(), sha256_file(), and other hashing algos

From: Date: Sat, 19 Nov 2005 20:35:34 +0000
Subject: Re: sha256(), sha256_file(), and other hashing algos
References: 1 2  Groups: php.internals 
Request: Send a blank email to internals+get-20183@lists.php.net to get a copy of this message
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

« previous php.internals (#20183) next »