Documentation

Hash.php

Pure-PHP implementations of keyed-hash message authentication codes (HMACs) and various cryptographic hashing functions.

Uses hash() or mhash() if available and an internal implementation, otherwise. Currently supports the following:

md2, md5, md5-96, sha1, sha1-96, sha256, sha256-96, sha384, and sha512, sha512-96

If setKey() is called, hash() will return the HMAC as opposed to the hash. If no valid algorithm is provided, sha1 will be used.

PHP version 5

}

Here's a short example of how to use this library:

setKey('abcdefg'); echo base64_encode($hash->hash('abcdefg')); ?>
Tags
category

Crypt

author

Jim Wigginton terrafrost@php.net

copyright

2007 Jim Wigginton

license

http://www.opensource.org/licenses/mit-license.html MIT License

link
http://phpseclib.sourceforge.net

Interfaces, Classes and Traits

Hash
Pure-PHP implementations of keyed-hash message authentication codes (HMACs) and various cryptographic hashing functions.

Search results