K2hash::create
Creates the k2hash file
Description
public static bool K2hash::create ( string $filepath [, int $maskbitcnt [, int $cmaskbitcnt [, int $maxelementcnt [, int $pagesize ]]]] )
Creates the k2hash (.k2h) file.
Parameters
- filepath
Specifies the path to the k2hash (.k2h) file. - maskbitcnt
Specifies key mask bit. The default value is 8. - cmaskbitcnt
Specifies key collision mask bit. The default value is 4. - maxelementcnt
Specifies the max number of duplicated elements if a hash collision occurs. The default value is 1024(bytes). - pagesize
Specifies a block size of data. The default value is 512(bytes).
Return Values
Returns true on success or false on failure.
Examples
- Example 1 - Creates a k2hash file
<?php
var_dump(K2hash::create("/tmp/test_k2hash.k2h"));
?>
The above example will output:
bool(true)