]> git.mxchange.org Git - friendica.git/blobdiff - library/asn1.php
API: beautify the output of repeated items
[friendica.git] / library / asn1.php
index 5b1ad3b8fb842b1af72fac865ed4f205125b7d54..e84398bf6207e2ff67aebe363cc34b742902b63c 100644 (file)
@@ -186,8 +186,7 @@ class ASN_BASE {
                        case ASN_BOOLEAN:
                                return new ASN_BOOLEAN((bool)$data);
                        case ASN_INTEGER:
-                               return new ASN_INTEGER(accum($data));
-//                             return new ASN_INTEGER(ord($data));
+                               return new ASN_INTEGER(strtr(base64_encode($data),'+/','-_'));
                        case ASN_BIT_STR:
                                return new ASN_BIT_STR(self::parseASNString($data, $level+1, $maxLevels));
                        case ASN_OCTET_STR:
@@ -290,14 +289,3 @@ class ASN_BASE {
        
 }
 
-
-function accum($s) {
-       $len = strlen($s);
-       $result = '';
-       for ($i=0; $i < $len; $i++)  {
-               $cur = substr($s,$i,1);
-               $result .= bin2hex($cur);
-    }
-    return $result;
-}
-