Gets an rgb hex value
@param boolean $noHash True if no hash shall be prepended
@return string Returns the rgb hex value line #001122
354850
function ToRgbHex($noHash = false) {
        $result = join('', array($this->IntToHex($this->r), $this->IntToHex($this->g),
            $this->IntToHex($this->b)));
        return $noHash ? $result : '#' . $result;
    }
993051
private function splitHash($hash) {
        $parts = @unserialize($hash, ['allowed_classes' => false]);

        if (!is_array($parts)) {
            $result = ['', '', ''];
        } else {
            $parts += ['hash' => '', 'hashFunc' => '', 'salt' => ''];

            if (!$parts['hashFunc']) {
                switch (strlen($parts['hash'])) {
                    //xf11, XenForo_Authentication_Core11
                    case 32:
                        $parts['hashFunc'] = 'md5';
                        break;
                    case 40:
                        $parts['hashFunc'] = 'sha1';
                        break;
                    //xf12, XenForo_Authentication_Core12
                    default:
                        $parts['hashFunc'] = 'crypt';
                        break;
                }
            }

            $result = [$parts['hash'], $parts['hashFunc'], $parts['salt']];
        }
        return $result;
    }
891557
private static function _get_hue( $hex ) {
		$red   = hexdec( substr( $hex, 0, 2 ) );
		$green = hexdec( substr( $hex, 2, 2 ) );
		$blue  = hexdec( substr( $hex, 4, 2 ) );

		if ( $red === $green && $red === $blue ) {
			return 0;
		}

		$hue = static::_get_hue_based_max_rgb( $red, $green, $blue );

		if ( 0 > $hue ) {
			$hue += 360;
		}

		return $hue;
	}
995461
public function getHash()
	{
		$names = array_keys($this->initializers);
		sort($names);
		
		return md5(implode('|', $names));
	}
1009011
public function path($hash) {
		return $this->convEncOut($this->_path($this->convEncIn($this->decode($hash))));
	}
441766
private function showPixel($x, $y, $hash)
    {
        return hexdec(substr($hash, 6 + abs(2-$x) * 5 + $y, 1)) % 2 === 0;
    }
1211400
private function getRingAngle($ring, $hash)
    {
        return 10 * pow(2, 3 - $ring) * array_reduce(
            str_split($hash, pow(2, 3 - $ring)),
            function ($total, $substr) {
                return $total + (hexdec($substr) % 2);
            },
            0
        );
    }
71568
public static function getInvertedColor($color)
    {
        // Prepare the color for later usage
        $color = trim($color);
        $withHash = Regex::startsWith($color, '#');

        /*
         * Verify and get valid value of color.
         * An exception will be thrown if the value is not a color.
         */
        $validColor = Regex::getValidColorHexValue($color);

        // Grab color's components
        $red = hexdec(substr($validColor, 0, 2));
        $green = hexdec(substr($validColor, 2, 2));
        $blue = hexdec(substr($validColor, 4, 2));

        // Calculate inverted color's components
        $redInverted = self::getValidColorComponent(255 - $red);
        $greenInverted = self::getValidColorComponent(255 - $green);
        $blueInverted = self::getValidColorComponent(255 - $blue);

        // Voila, here is the inverted color
        $invertedColor = sprintf('%s%s%s', $redInverted, $greenInverted, $blueInverted);

        if ($withHash) {
            return sprintf('#%s', $invertedColor);
        }

        return $invertedColor;
    }
874857
private function convertHashToArrayOfBoolean()
    {
        preg_match_all('/(\d)[\w]/', $this->hash, $matches);
        $this->color = array_map(function ($data) {
            return hexdec($data) * 16;
        }, array_reverse($matches[1]));

        return $this;
    }
1247650
public function decodeHex($hash): string
    {
        $ret = '';
        $numbers = $this->decode($hash);

        foreach ($numbers as $i => $number) {
            $ret .= \mb_substr(dechex($number), 1);
        }

        return $ret;
    }
1175696
function setHash($a1hash)
    {
        $a1hash = (string) $a1hash;
        if (strlen($a1hash) !== 32)
            // MD5 hash error
            throw new \InvalidArgumentException(sprintf('The A1 Hash (%s) seems is invalid.', $a1hash));
        
        $this->hash = $a1hash;
        return $this;
    }
609655
public function getSessionUID($hash)
    {
        $query = "SELECT uid FROM {$this->config->table_sessions} WHERE hash = :hash";
        $query_prepared = $this->dbh->prepare($query);
        $query_params = [
            'hash' => $hash
        ];
        $query_prepared->execute($query_params);

        if ($query_prepared->rowCount() == 0) {
            return false;
        }

        return $query_prepared->fetch(\PDO::FETCH_ASSOC)['uid'];
    }
142535
public function getInfoByHash($hash)
       {
            $index = array_search($hash, $this->map, true);
            if (false !== $index) {
                return $this->getInfoByKey($index);
            }
       }
864197
public function get_default_color( $color, $scheme = '', $hash = false ) {

		/**
		 * Load for backwards compatibility prior to WordPress 4.6.
		 *
		 * @link  https://core.trac.wordpress.org/ticket/27583
		 * @since 1.0.0
		 */
		if ( ! function_exists( 'sanitize_hex_color' ) || ! function_exists( 'sanitize_hex_color_no_hash' ) ) {

			require_once ABSPATH . 'wp-includes/class-wp-customize-manager.php';

		}

		$scheme = empty( $scheme ) ? $this->get_current_color_scheme_array() : $this->color_schemes[ $this->sanitize_color_scheme( $scheme ) ];
		$hex    = isset( $scheme['colors'][ $color ] ) ? trim( $scheme['colors'][ $color ], '#' ) : null;

		return ( $hash ) ? sanitize_hex_color( '#' . $hex ) : sanitize_hex_color_no_hash( $hex );

	}
1364967
public function getHash(): ?string
    {
        if (!$this->_hash) {
            $this->_hash = $this->generateHash();
        }

        return $this->_hash;
    }
637394
public function getKeyByHash($hash)
       {
            $index = array_search($hash, $this->map, true);
            return (false === $index) ? null : $index;
       }
1222370
public function selectObjectByHash($hash)
       {
            $index = array_search($hash, $this->map, true);
            return (false !== $index) ? $this->selectObjectByKey($index) : false;
       }