Created
June 6, 2013 08:51
-
-
Save phnessu4/5720219 to your computer and use it in GitHub Desktop.
Export Caesar Hash
This file contains 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 | |
//Export Caesar Hash | |
$hash = array_flip(array('0','1','2','3','4','5','6','7','8','9','a','b','c','d','e','f')); | |
$hash_length = count($hash); | |
$arr = array('a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z'); | |
foreach ($hash as $key => $value) { | |
$arr_index = rand(0, count($arr)-1); | |
$hash[$key] = $arr[$arr_index]; | |
unset($arr[$arr_index]); | |
sort($arr); | |
// print_r("hash key: ".$key." ,arr length: ".count($arr)." ,arr index: ".$arr_index." ,arr value : ". $arr[$arr_index]); | |
// print_r($arr); | |
} | |
print_r($hash); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment