@param string $text
@param string $hash
@param string $format

@return bool
168593
public static function verifyHash(string $hash, string $text, string $format = null): bool
    {
        return \hash_equals($hash, self::hash($text, $format));
    }
439239
public static function validate($format, $timeString)
	{
		$time = DateTime::createFromFormat($format, $timeString);

		return ($time !== FALSE) && ($timeString === $time->format($format));
	}
1281485
public function sha256($format = null, $raw_output = false)
	{
		return hash('sha256', parent::format($format === null ? static::$format : $format), $raw_output);
	}
891088
private function getStreamHash($stream, $hash = 'md5')
    {
        $hc = hash_init($hash);
        hash_update_stream($hc, $stream);
        return hash_final($hc);
    }
1081150
public static function valid(string $date, string $format): bool {
        return date($format, strtotime($date)) === $date;

    }
748707
public static function getFormattedDate($date, $format)
    {
        if (StringUtils::isEmpty($date) || StringUtils::isEmpty($format)) {
            return null;
        }

        return date($format, strtotime($date));
    }
340232
protected function checkFormat($format, $type = null)
    {
        return !is_null($format) ? $format : $this->getFormat($type);
    }
91025
public static function isDate($date = false, $format = 'Y-m-d H:i:s') {

        if($date) {

            $DateTime = DateTime::createFromFormat($format, $date);
            return $DateTime && $DateTime->format($format) == $date;
        }
        
        return false;
    }
205736
public static function setStringFormat(string $format)
    {
        switch ($format) {
            case 'raw':
                self::$format = 'raw';
                break;
            case 'basic':
                self::$format = 'basic';
                break;
            case 'full':
            default:
                self::$format = 'full';
                break;
        }
    }
1209937
protected function volume($hash) {
		foreach ($this->volumes as $id => $v) {
			if (strpos(''.$hash, $id) === 0) {
				return $this->volumes[$id];
			} 
		}
		return false;
	}
1330982
public static function hash(string $text, string $format = null): string
    {
        $format = $format ?? self::$format;

        if (self::FORMAT_HEX === $format) {
            return \hash(self::HASH_TYPE, $text, false);
        }

        $raw = \hash(self::HASH_TYPE, $text, true);

        return self::fromRaw($raw, $format);
    }
826012
public function format($text = '', string $style = 'none')
    {
        return $this->getStartMark($style) . $text . $this->getClearMark();
    }
751010
public static function verify($string, $hash, array $arguments = [])
    {
        return self::instance()->{__FUNCTION__}($string, $hash, $arguments);
    }
1319934
public static function verifyPassword(string $password, string $hash)
    {
        if (\password_verify($password, $hash)) {
            if (\password_needs_rehash($hash, \PASSWORD_DEFAULT)) {
                return self::password($password);
            }

            return true;
        }

        return false;
    }
647699
public static function isSupportedFormat($format)
    {
        if (!is_string($format)) {
            throw new Exception\InvalidArgumentException(__METHOD__ . " file_format must be a string");
        }
        return in_array((string) $format, self::$supportedFormats);
    }
483408
public function supportsNormalization($data, $format = null): bool
    {
        if (true === \is_object($data))
        {
            $class = \get_class($data);

            if (false === isset($this->localStorage[$class]))
            {
                $this->localStorage[$class] = \array_map(
                    static function(\ReflectionProperty $property): string
                    {
                        return (string) $property->name;
                    },
                    (new \ReflectionClass($data))->getProperties()
                );
            }

            return empty($this->localStorage[$class]);
        }

        return false;
    }
472532
public function assertStringMatchesFormat($format, $message = '')
    {
        Assert::assertStringMatchesFormat($format, $this->getData(), $message);

        return $this;
    }