HEX
Server: Apache
System: Linux sg241.singhost.net 2.6.32-896.16.1.lve1.4.51.el6.x86_64 #1 SMP Wed Jan 17 13:19:23 EST 2018 x86_64
User: honghock (909)
PHP: 8.0.30
Disabled: passthru,system,shell_exec,show_source,exec,popen,proc_open
Upload Files
File: /home/honghock/www/wp-content/plugins/wordfence/vendor/wordfence/mmdb-reader/src/Endianness.php
<?php

namespace Wordfence\MmdbReader;

class Endianness {

	const BIG = 0;
	const LITTLE = 1;

	private static $SYSTEM = null;

	private static function detect() {
		$test = unpack('S', "\x00\x01");
		return $test[1] >> 8;
	}

	public static function get() {
		if (self::$SYSTEM === null)
			self::$SYSTEM = self::detect();
		return self::$SYSTEM;
	}

	public static function isBig() {
		return self::get() === self::BIG;
	}

	public static function isLittle() {
		return self::get() === self::LITTLE;
	}

	public static function convert($value, $source, $target = null) {
		if ($target === null)
			$target = self::get();
		if ($target === $source)
			return $value;
		return strrev($value);
	}

}