下载Mcrypt软件包。
gunzipmcrypt-x.x.x.tar.gz
tar -xvfmcrypt-x.x.x.tar
./configure --disable-posix-threads
make
make install
cd to your PHP directory.
./configure -with-mcrypt=[dir] [--other-configuration-directives]
make
make install
固然了,依据你的请求和PHP装置时与互联网办事器软件的关系,下面的进程能够需求作恰当的修正。
下载Mhash扩大库
gunzipmhash-x.x.x.tar.gz
tar -xvfmhash-x.x.x.tar
./configure
make
make install
cd <PHP地点的目次>
./configure -with-mhash=[dir] [--other-configuration-directives]
make
make install
象Mcrypt一样,依据PHP在互联网办事器软件上的装置体例,能够需求对Mhash停止其他的设置装备摆设。
<?php
$hash_alg = MHASH_TIGER;
$message = "These are the directions to the secret fort. Two steps left, three steps right, and cha chacha.";
$hashed_message = mhash($hash_alg, $message);
print "The hashed message is ". bin2hex($hashed_message);
?>