X-Git-Url: https://git.p6c8.net/jirafeau_mojo42.git/blobdiff_plain/d9647e1afea29401470efd68730d2562659be006..2fa05274bd24134ecf87bda06ce2626483ec3513:/lib/functions.php

diff --git a/lib/functions.php b/lib/functions.php
index 77acae1..1800231 100644
--- a/lib/functions.php
+++ b/lib/functions.php
@@ -1134,3 +1134,14 @@ function get_ip_address($cfg) {
     }
     return $_SERVER['REMOTE_ADDR'];
 }
+
+/**
+ * Convert hexadecimal string to base64
+ */
+function hex_to_base64($hex)
+{
+    $b = '';
+    foreach (str_split ($hex, 2) as $pair)
+        $b .= chr (hexdec ($pair));
+    return base64_encode ($b);
+}