<?php
class kv_hash
{
function hash_string( $string )
{
$from = array( '1', '2', '3', '4', '5', '6', '7', '8', '9', '0', 'a',
'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l',
'm', 'n', 'o', 'p', 'r', 's', 't', 'u', 'w', 'x', 'y',
'z'
);
$to = array( 'H', 'f', 'C', 'p', 'o', '3', '5', 'A', '2', 'O', '4',
's', 'E', 'V', 'a', 'R', 'u', 'J', 'b', 'P', 'i', 'U',
'Z', 'f', '0', '7', '1', 'G', 'b', 'h', 'B', 'Y', 'x',
'e'
);
$ret = str_replace( $from, $to, $string );
return $ret;
}
function hash_file( $file )
{
$from = array( '1', '2', '3', '4', '5', '6', '7', '8', '9', '0', 'a',
'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l',
'm', 'n', 'o', 'p', 'r', 's', 't', 'u', 'w', 'x', 'y',
'z'
);
$to = array( 'H', 'f', 'C', 'p', 'o', '3', '5', 'A', '2', 'O', '4',
's', 'E', 'V', 'a', 'R', 'u', 'J', 'b', 'P', 'i', 'U',
'Z', 'f', '0', '7', '1', 'G', 'b', 'h', 'B', 'Y', 'x',
'e'
);
$file = file( $file );
for( $i = 0; $i<count( $file ); $i++ )
{
echo '<br /><br />' . $ret = str_replace( $from, $to, $file[$i] );
}
}
}
?>