Ramsey\Uuid\UuidFactory::uuidFromHashedName PHP Method

uuidFromHashedName() protected method

Returns a Uuid created from $hash with the version field set to $version and the variant field set for RFC 4122
protected uuidFromHashedName ( string $hash, integer $version ) : UuidInterface
$hash string The hash to use when creating the UUID
$version integer The UUID version to set for this hash (1, 3, 4, or 5)
return UuidInterface
    protected function uuidFromHashedName($hash, $version)
    {
        $timeHi = BinaryUtils::applyVersion(substr($hash, 12, 4), $version);
        $clockSeqHi = BinaryUtils::applyVariant(hexdec(substr($hash, 16, 2)));
        $fields = array('time_low' => substr($hash, 0, 8), 'time_mid' => substr($hash, 8, 4), 'time_hi_and_version' => sprintf('%04x', $timeHi), 'clock_seq_hi_and_reserved' => sprintf('%02x', $clockSeqHi), 'clock_seq_low' => substr($hash, 18, 2), 'node' => substr($hash, 20, 12));
        return $this->uuid($fields);
    }