|
QuickHashStringIntHash::loadFromFileThis factory method creates a hash from a file 説明
public static QuickHashStringIntHash QuickHashStringIntHash::loadFromFile(string
$filename , int $size = 0, int $options = 0)
This factory method creates a new hash from a definition file on disk. The
file format consists of a signature
例1 QuickHash StringIntHash file format 00000000 51 48 21 00 02 00 00 00 09 00 00 00 40 00 00 00 |QH!.........@...| 00000010 4f 4e 45 00 4e 49 4e 45 00 07 00 00 00 01 00 00 |ONE.NINE........| 00000020 00 00 00 00 00 01 00 00 00 2f 00 00 00 01 00 00 |........./......| 00000030 00 04 00 00 00 03 00 00 00 |.........| 00000039
例2 QuickHash IntHash file format header signature ('QH'; key type: 2; value type: 1; filler: \0x00) 00000000 51 48 21 00 number of elements: 00000004 02 00 00 00 length of string values (9 characters): 00000008 09 00 00 00 number of hash bucket lists (this is configured for hashes as argument to the constructor normally, 64 in this case): 0000000C 40 00 00 00 string values: 00000010 4f 4e 45 00 4e 49 4e 45 00 bucket lists: bucket list 1 (with key 7, and 1 element): header: 07 00 00 00 01 00 00 00 elements (key index: 0 ('ONE'), value = 0): 00 00 00 00 01 00 00 00 bucket list 2 (with key 0x2f, and 1 element): header: 2f 00 00 00 01 00 00 00 elements (key index: 4 ('NINE'), value = 3): 04 00 00 00 03 00 00 00 パラメータ
戻り値Returns a new QuickHashStringIntHash. 例
例3 QuickHashStringIntHash::loadFromFile example
上の例の出力は、 たとえば以下のようになります。 11l4 => 48712 12uf => 50343 143q => 51974 15d1 => 53605 16mc => 55236 17vn => 56867 194y => 58498 1ae9 => 60129 1bnk => 61760 1cwv => 63391 1e66 => 65022 1ffh => 66653 1gos => 68284 1hy3 => 69915 1j7e => 71546 1kgp => 73177 |