diff options
Diffstat (limited to 'boot.php')
-rw-r--r-- | boot.php | 17 |
1 files changed, 16 insertions, 1 deletions
@@ -2969,4 +2969,19 @@ function generate_guid() { $found = false; } while ($found == true ); return $guid; -}
\ No newline at end of file +} + + +function pkcs5_pad ($text, $blocksize) +{ + $pad = $blocksize - (strlen($text) % $blocksize); + return $text . str_repeat(chr($pad), $pad); +} + +function pkcs5_unpad($text) +{ + $pad = ord($text{strlen($text)-1}); + if ($pad > strlen($text)) return false; + if (strspn($text, chr($pad), strlen($text) - $pad) != $pad) return false; + return substr($text, 0, -1 * $pad); +} |