summaryrefslogtreecommitdiff
path: root/ext/hash/hash.c
diff options
context:
space:
mode:
authorMichael Maclean <mgdm@php.net>2010-03-23 22:21:39 +0000
committerMichael Maclean <mgdm@php.net>2010-03-23 22:21:39 +0000
commitd05ce2574605ced3ef8a15ca15eb6f4ac536f745 (patch)
treec44a8be68714a51f06892547c3608b4f74e08e5f /ext/hash/hash.c
parent880bde60a2e507472cf860c8dfa99a54145b8fd0 (diff)
downloadphp-git-d05ce2574605ced3ef8a15ca15eb6f4ac536f745.tar.gz
Add FNV-1 support to ext/hash
Diffstat (limited to 'ext/hash/hash.c')
-rw-r--r--ext/hash/hash.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/ext/hash/hash.c b/ext/hash/hash.c
index 73b0931a01..75acc81599 100644
--- a/ext/hash/hash.c
+++ b/ext/hash/hash.c
@@ -74,7 +74,11 @@ static struct mhash_bc_entry mhash_to_hash[MHASH_NUM_ALGOS] = {
{"RIPEMD320", "ripemd320", 25},
{NULL, NULL, 26}, /* support needs to be added for snefru 128 */
{"SNEFRU256", "snefru256", 27},
- {"MD2", "md2", 28}
+ {"MD2", "md2", 28},
+ {"FNV132", "fnv132", 29},
+ {"FNV1a32", "fnv1a32", 30},
+ {"FNV164", "fnv164", 31},
+ {"FNV1a64", "fnv1a64", 32},
};
#endif
@@ -841,6 +845,8 @@ PHP_MINIT_FUNCTION(hash)
php_hash_register_algo("crc32b", &php_hash_crc32b_ops);
php_hash_register_algo("salsa10", &php_hash_salsa10_ops);
php_hash_register_algo("salsa20", &php_hash_salsa20_ops);
+ php_hash_register_algo("fnv132", &php_hash_fnv132_ops);
+ php_hash_register_algo("fnv164", &php_hash_fnv164_ops);
PHP_HASH_HAVAL_REGISTER(3,128);
PHP_HASH_HAVAL_REGISTER(3,160);