發新話題

[分享] 《PHP》『Mhash函式庫』

《PHP》『Mhash函式庫』

《PHP》『Mhash函式庫』mhash_get_hash_name --- 取得拼湊的名稱

mhash_get_hash_name

(PHP3 >= 3.0.9 , PHP4)

mhash_get_hash_name ---  取得拼湊的名稱

語法 : string mhash_get_hash_name (int hash)

說明 :

mhash_get_hash_name( )用來取得指定的拼湊(hash)的名稱。

mhash_get_hash_name( )取參數的拼湊 id,並且傳回拼湊的名稱,如果拼湊不存在,則傳回false。

Example :

<?php

   $hash = MHASH_MD5;

   print mhash_get_hash_name ($hash);

?>

上面的範例將會顯示出 : MD5



[ 本帖最後由 蔡逸竹 於 2006-9-24 12:53 編輯 ]

TOP

《PHP》『Mhash函式庫』mhash_get_block_size --- 取得拼湊的區塊大小

mhash_get_block_size

(PHP3 >= 3.0.9 , PHP4)

mhash_get_block_size ---  取得拼湊的區塊大小

語法 : int mhash_get_block_size (int hash)

說明 :

mhash_get_block_size( )用來取得參數hash的區塊(block)的大小。

mhash_get_block_size( )取一參數hash,並且傳回位元組大小如果拼湊不存在,則傳回false。

TOP

《PHP》『Mhash函式庫』mhash_count --- 取得最高的有效的拼湊 id

mhash_count

(PHP3 >= 3.0.9 , PHP4)

mhash_count ---  取得最高的有效的拼湊 id

語法 : int mhash_count (void)

說明 :

mhash_count( )傳回最高的有效的拼湊 id,拼湊數值是從0到此拼湊 id。

Example :

<?php

   $nr = mhash_count();

   for ($i = 0; $i <= $nr; $i++) {

         echo sprintf ("The blocksize of %s is %d\n", mhash_get_hash_name ($i), mhash_get_block_size ($i));

  }

?>

TOP

《PHP》『Mhash函式庫』mhash --- 計算拼湊

mhash

(PHP3 >= 3.0.9 , PHP4)

mhash ---  計算拼湊

語法 : string mhash (int hash, string data)

說明 :

mhash( )將參數data依照指定的拼湊方式hash將資料拼湊,並且傳回拼湊的結果。

TOP

發新話題

本站所有圖文均屬網友發表,僅代表作者的觀點與本站無關,如有侵權請通知版主會盡快刪除。