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

Software: Apache/2.4.41 (Ubuntu). PHP/8.0.30 

uname -a: Linux apirnd 5.4.0-204-generic #224-Ubuntu SMP Thu Dec 5 13:38:28 UTC 2024 x86_64 

uid=33(www-data) gid=33(www-data) groups=33(www-data) 

Safe-mode: OFF (not secure)

/uploads/script/vendor/ramsey/uuid/src/Codec/   drwxr-xr-x
Free 13.17 GB of 57.97 GB (22.72%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Self remove    Logout    


Viewing file:     OrderedTimeCodec.php (3.54 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\InvalidArgumentException;
use 
Ramsey\Uuid\Exception\UnsupportedOperationException;
use 
Ramsey\Uuid\Rfc4122\FieldsInterface as Rfc4122FieldsInterface;
use 
Ramsey\Uuid\Uuid;
use 
Ramsey\Uuid\UuidInterface;

use function 
strlen;
use function 
substr;

/**
 * OrderedTimeCodec encodes and decodes a UUID, optimizing the byte order for
 * more efficient storage
 *
 * For binary representations of version 1 UUID, this codec may be used to
 * reorganize the time fields, making the UUID closer to sequential when storing
 * the bytes. According to Percona, this optimization can improve database
 * INSERTs and SELECTs using the UUID column as a key.
 *
 * The string representation of the UUID will remain unchanged. Only the binary
 * representation is reordered.
 *
 * **PLEASE NOTE:** Binary representations of UUIDs encoded with this codec must
 * be decoded with this codec. Decoding using another codec can result in
 * malformed UUIDs.
 *
 * @link https://www.percona.com/blog/2014/12/19/store-uuid-optimized-way/ Storing UUID Values in MySQL
 *
 * @psalm-immutable
 */
class OrderedTimeCodec extends StringCodec
{
    
/**
     * Returns a binary string representation of a UUID, with the timestamp
     * fields rearranged for optimized storage
     *
     * @inheritDoc
     * @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
    
{
        if (
            !(
$uuid->getFields() instanceof Rfc4122FieldsInterface)
            || 
$uuid->getFields()->getVersion() !== Uuid::UUID_TYPE_TIME
        
) {
            throw new 
InvalidArgumentException(
                
'Expected RFC 4122 version 1 (time-based) UUID'
            
);
        }

        
$bytes $uuid->getFields()->getBytes();

        return 
$bytes[6] . $bytes[7]
            . 
$bytes[4] . $bytes[5]
            . 
$bytes[0] . $bytes[1] . $bytes[2] . $bytes[3]
            . 
substr($bytes8);
    }

    
/**
     * Returns a UuidInterface derived from an ordered-time binary string
     * representation
     *
     * @throws InvalidArgumentException if $bytes is an invalid length
     *
     * @inheritDoc
     */
    
public function decodeBytes(string $bytes): UuidInterface
    
{
        if (
strlen($bytes) !== 16) {
            throw new 
InvalidArgumentException(
                
'$bytes string should contain 16 characters.'
            
);
        }

        
// Rearrange the bytes to their original order.
        
$rearrangedBytes $bytes[4] . $bytes[5] . $bytes[6] . $bytes[7]
            . 
$bytes[2] . $bytes[3]
            . 
$bytes[0] . $bytes[1]
            . 
substr($bytes8);

        
$uuid parent::decodeBytes($rearrangedBytes);

        if (
            !(
$uuid->getFields() instanceof Rfc4122FieldsInterface)
            || 
$uuid->getFields()->getVersion() !== Uuid::UUID_TYPE_TIME
        
) {
            throw new 
UnsupportedOperationException(
                
'Attempting to decode a non-time-based UUID using '
                
'OrderedTimeCodec'
            
);
        }

        return 
$uuid;
    }
}

:: Command execute ::

Enter:
 
Select:
 

:: Search ::
  - regexp 

:: Upload ::
 
[ Read-Only ]

:: Make Dir ::
 
[ Read-Only ]
:: Make File ::
 
[ Read-Only ]

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

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