|
PHP5中文手册
Mhash Functions简介These functions are intended to work with » mhash. Mhash can be used to create checksums, message digests, message authentication codes, and more. This is an interface to the mhash library. mhash supports a wide variety of hash algorithms such as MD5, SHA1, GOST, and many others. For a complete list of supported hashes, refer to the documentation of mhash. The general rule is that you can access the hash algorithm from PHP with MHASH_HASHNAME. For example, to access TIGER you use the PHP constant MHASH_TIGER.
需求To use it, download the mhash distribution from » its web site and follow the included installation instructions. 安装You need to compile PHP with the --with-mhash[=DIR] parameter to enable this extension. DIR is the mhash install directory. 运行时配置本扩展模块在 php.ini 中未定义任何配置选项。 资源类型本扩展模块未定义任何资源类型。 预定义常量以下常量由本扩展模块定义,因此只有在本扩展模块被编译到 PHP 中,或者在运行时被动态加载后才有效。 Here is a list of hashes which are currently supported by mhash. If a hash is not listed here, but is listed by mhash as supported, you can safely assume that this documentation is outdated.
范例
Example#1 Compute the MD5 digest and hmac and print it out as hex
<?php This will produce:
Table of Contents
|