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
| /** | |
| * RC4 symmetric cipher encryption/decryption | |
| * @see https://gist.github.com/farhadi/2185197 and https://en.wikipedia.org/wiki/RC4 | |
| * @license Public Domain | |
| * | |
| * @param key - secret key for encryption/decryption | |
| * @param str - string to be encrypted/decrypted | |
| * @return string | |
| */ | |
| function rc4(key, str){ |
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
| function crc16($string, $crc = 0) { | |
| for($x = 0; $x < strlen($string); $x++) { | |
| $crc = $crc ^ ord($string[$x]); | |
| echo $crc . '<br />'; | |
| for($y = 0; $y < 8; $y++) { | |
| if(($crc & 0x0001) == 0x0001) { | |
| $crc = (($crc >> 1) ^ 0x10589); |