403Webshell
Server IP : 51.89.169.208  /  Your IP : 18.119.126.168
Web Server : Apache
System : Linux ns3209505.ip-198-244-202.eu 4.18.0-553.27.1.el8_10.x86_64 #1 SMP Tue Nov 5 04:50:16 EST 2024 x86_64
User : yellowleaf ( 1019)
PHP Version : 7.4.33
Disable Function : exec,passthru,shell_exec,system
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : ON
Directory :  /home/yellowleaf/public_html/phpMyAdmin/vendor/fgrosse/phpasn1/lib/ASN1/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /home/yellowleaf/public_html/phpMyAdmin/vendor/fgrosse/phpasn1/lib/ASN1/Base128.php
<?php

namespace FG\ASN1;

use FG\Utility\BigInteger;
use InvalidArgumentException;

/**
 * A base-128 decoder.
 */
class Base128
{
    /**
     * @param int $value
     *
     * @return string
     */
    public static function encode($value)
    {
        $value = BigInteger::create($value);
        $octets = chr($value->modulus(0x80)->toInteger());

        $value = $value->shiftRight(7);
        while ($value->compare(0) > 0) {
            $octets .= chr(0x80 | $value->modulus(0x80)->toInteger());
            $value = $value->shiftRight(7);
        }

        return strrev($octets);
    }

    /**
     * @param string $octets
     *
     * @throws InvalidArgumentException if the given octets represent a malformed base-128 value or the decoded value would exceed the the maximum integer length
     *
     * @return int
     */
    public static function decode($octets)
    {
        $bitsPerOctet = 7;
        $value = BigInteger::create(0);
        $i = 0;

        while (true) {
            if (!isset($octets[$i])) {
                throw new InvalidArgumentException(sprintf('Malformed base-128 encoded value (0x%s).', strtoupper(bin2hex($octets)) ?: '0'));
            }

            $octet = ord($octets[$i++]);

            $l1 = $value->shiftLeft($bitsPerOctet);
            $r1 = $octet & 0x7f;
            $value = $l1->add($r1);

            if (0 === ($octet & 0x80)) {
                break;
            }
        }

        return (string)$value;
    }
}

Youez - 2016 - github.com/yon3zu
LinuXploit