Unhash given input value.

@param string $input
@param string $alphabet

@return int
551951
protected function unhash($input, $alphabet)
    {
        $number = 0;
        $inputLength = strlen($input);

        if ($inputLength && $alphabet) {
            $alphabetLength = strlen($alphabet);
            $inputChars = str_split($input);

            foreach ($inputChars as $char) {
                $position = strpos($alphabet, $char);
                $number = Math::multiply($number, $alphabetLength);
                $number = Math::add($number, $position);
            }
        }

        return $number;
    }
1194248
protected function removeFilesFromInput(array $input)
    {
        foreach ($input as $key => $value) {
            if (is_array($value)) {
                $input[$key] = $this->removeFilesFromInput($value);
            }

            if ($value instanceof SymfonyUploadedFile) {
                unset($input[$key]);
            }
        }

        return $input;
    }
267676
public function unserialize($input)
	{
		// Unserialize the executable, args, options, data, and inputs.
		list($this->executable, $this->args, $this->options, $this->data, $this->inputs) = unserialize($input);

		// Load the filter.
		if (isset($this->options['filter']))
		{
			$this->filter = $this->options['filter'];
		}
		else
		{
			$this->filter = new Filter\InputFilter;
		}
	}
222024
public static function fromString(string $input): self
    {
        $input = preg_replace('/[^\d]/', '', $input);

        if (!is_numeric($input)) {
            throw new \InvalidArgumentException("Expects \$input to be a number, \"{$input}\" given.");
        }

        // Get the last digit.
        $checkDigit = (int) $input[strlen($input) - 1];

        // Remove the last digit.
        $number = substr($input, 0, strlen($input) - 1);

        return new self($number, $checkDigit);
    }
1317404
public static function convert($input = STDIN)
    {
        $stream = fopen('php://temp', 'rw');

        foreach ($_SERVER as $key => $value) {
            if (0 === strpos($key, 'HTTP_')) {
                $key = str_replace('_', '-', strtolower(substr($key, 5)));
                fwrite($stream, "$key: $value\r\n");
            } elseif (in_array($key, ['CONTENT_LENGTH', 'CONTENT_MD5', 'CONTENT_TYPE'])) {
                $key = str_replace('_', '-', strtolower($key));
                fwrite($stream, "$key: $value\r\n");
            }
        }

        fwrite($stream, "\r\n");

        stream_copy_to_stream($input, $stream);

        rewind($stream);

        return new StreamedPart($stream);
    }
95875
public function validateLuhn($input)
    {
        $checksum = '';
        foreach (str_split(strrev($input)) as $i => $d) {
            $checksum .= ($i %2 !== 0) ? ($d * 2) : $d;
        }
        return array_sum(str_split($checksum)) % 10 === 0;
    }
912576
protected function _unserialize($input)
	{
		$data = @unserialize($input);

		if (is_array($data))
		{
			foreach ($data as $key => $val)
			{
				if (is_string($val))
				{
					$data[$key] = str_replace('{{slash}}', '\\', $val);
				}
			}

			return $data;
		}

		elseif ($data === false)
		{
			is_string($input) and $data = array($input);
		}

		return (is_string($data)) ? str_replace('{{slash}}', '\\', $data) : $data;
	}
128740
public function unserialize($input)
    {
        $htmlCleaner = unserialize($input);

        $this->htmlCleaner = $htmlCleaner;

        $this->loadDefaultHandlers();
    }
53186
public function convertFromNegative($input)
    {
        if (strpos('/*', $input[0]) !== false) {
            $input = substr($input, 1);
        }

        $input = strtr($input, static::NEGATIVE_CHARS, static::POSITIVE_CHARS);

        $res = $this->convertFromPositive($input);

        if (preg_match('/^0+$/', $res)) {
            return $res;
        }

        return '-' . $res;
    }
434100
protected static function toBase10(
        /*# string */ $input,
        /*# string */ $fromBase
    )/*# string */ {
        $len = strlen($fromBase);
        $res = '0';
        foreach (str_split($input) as $char) {
            $res = bcadd((int) strpos($fromBase, $char), bcmul($res, $len));
        }
        return $res;
    }
538165
protected function _decodePart($input)
    {
        $n = static::INITIAL_N;
        $i = 0;
        $bias = static::INITIAL_BIAS;
        $output = '';

        $pos = strrpos($input, static::DELIMITER);
        if ($pos !== false) {
            $output = substr($input, 0, $pos++);
        } else {
            $pos = 0;
        }

        $outputLength = strlen($output);
        $inputLength = strlen($input);

        /* Punycode lookup is case-insensitive. */
        $input = Horde_String::lower($input);

        while ($pos < $inputLength) {
            $oldi = $i;
            $w = 1;

            for ($k = static::BASE; ; $k += static::BASE) {
                $digit = static::$_decodeTable[$input[$pos++]];
                $i = $i + ($digit * $w);
                $t = $this->_calculateThreshold($k, $bias);

                if ($digit < $t) {
                    break;
                }

                $w = $w * (static::BASE - $t);
            }

            $bias = $this->_adapt($i - $oldi, ++$outputLength, ($oldi === 0));
            $n = $n + (int) ($i / $outputLength);
            $i = $i % ($outputLength);

            $output = Horde_String::substr($output, 0, $i, 'UTF-8') .
                $this->_codePointToChar($n) .
                Horde_String::substr($output, $i, $outputLength - 1, 'UTF-8');

            ++$i;
        }

        return $output;
    }
1138314
private function decryptBlock($input, $key)
    {
        if (!$input && !$key) {
            return '';
        }

        $this->prepareCipher($key);
        $result = mdecrypt_generic($this->mcrypt, $input);
        mcrypt_generic_deinit($this->mcrypt);

        return $result;
    }
1189501
public function clean($input)
	{
		// Nothing to escape for non-string scalars, or for already processed values
		if (is_bool($input) or is_int($input) or is_float($input) or $this->parent->isCleaned($input))
		{
			return $input;
		}

		if (is_string($input))
		{
			$input = $this->cleanString($input);
		}

		elseif (is_array($input) or ($input instanceof \Iterator and $input instanceof \ArrayAccess))
		{
			$input = $this->cleanArray($input);
		}

		elseif ($input instanceof \Iterator or get_class($input) == 'stdClass')
		{
			$input = $this->cleanObject($input);
		}

		elseif (is_object($input))
		{
			// Check if the object is whitelisted and just return when that's the case
			foreach ($this->parent->getConfig('whitelistedClasses', array()) as $class)
			{
				if (is_a($input, $class))
				{
					return $input;
				}
			}

			// Throw exception when it wasn't whitelisted and can't be converted to String
			if (! method_exists($input, '__toString'))
			{
				throw new \RuntimeException('Object class "'.get_class($input).'" could not be converted to string or '.
					                            'sanitized as ArrayAccess. Whitelist it in security.whitelisted_classes in [application]/config/security.php '.
					                            'to allow it to be passed unchecked.');
			}

			$input = $this->cleanString(strval($input));
		}

		// mark this variable as cleaned
		$this->parent->isClean($input);

		return $input;
	}
232792
public static function hash($input, $timestamp, $iteration, $salt) {
		$iteration = intval($iteration);
		if ($iteration <= 0) {
			return false;
		}

		for ($i = 0; $i < $iteration; ++$i) {
			$input = base_convert(sha1($input.$salt.$timestamp), 16, 36);
		}
		return $input;
	}
563538
public function getLength($input)
    {
        if (is_scalar($input)) {
            if ($this->countByChars) {
                return mb_strlen($input, $this->charset);
            } else {
                return strlen($input);
            }
        } elseif (is_array($input) || $input instanceof \Countable) {
            return count($input);
        } else {
            return false;
        }
    }
299538
public function match($input)
    {
       
        $noMatch = true;
        foreach ($this->matchers as $matcher) {
            if ($matcher->noMatch()) {
                continue;
            }
            if ($matcher->match($input)) {
                $noMatch = false;
            }
            if ($matcher->matchFound()) {
                $this->matched[] = $matcher->matched;
                $this->resetMatchers();
                break;
            }
        }
        if ($noMatch) {
            return false;
        }
        return true;
    }
1096960
public function removeEmptyInput($input)
    {
        $filterableInput = [];

        foreach ($input as $key => $val) {
            if ($val !== '' && $val !== null) {
                $filterableInput[$key] = $val;
            }
        }

        return $filterableInput;
    }