aboutsummaryrefslogtreecommitdiffstats
path: root/boot.php
diff options
context:
space:
mode:
Diffstat (limited to 'boot.php')
-rw-r--r--boot.php17
1 files changed, 16 insertions, 1 deletions
diff --git a/boot.php b/boot.php
index 68cda3bf2..5d4f54769 100644
--- a/boot.php
+++ b/boot.php
@@ -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);
+}