Created
March 23, 2016 10:25
-
-
Save alherd-by/dd5919a242a999843caa to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require_once 'HastTable.php'; | |
const LENGTH = 150; | |
$length = LENGTH; | |
$division = function ($key) { | |
return $key % LENGTH; | |
}; | |
$hastTableDiv = new HastTable($division); | |
for ($i = 0; $i < 10; $i++) { | |
$key = random_int(1000000000000, 9999999999999); | |
$hastTableDiv[$key] = random_int(1, 10); | |
} | |
$radixChange = function ($key) { | |
return (int)base_convert($key, 10, 9) % LENGTH; | |
}; | |
for ($i = 0; $i < 10; $i++) { | |
$key = random_int(1000000000000, 9999999999999); | |
$hastTableRad[$key] = random_int(1, 10); | |
} | |
$hastTableRad = new HastTable($radixChange); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment