public function typeIdIn(int $uuid, int $expecting_type_id = null, bool $validate = true): int
    {
        $type_id = ($uuid >> (64 - 2 - 16 - 8)) & 255;

        if (isset($expecting_type_id)) {
            $this->validateTypeId($type_id, $expecting_type_id);
        } elseif ($validate) {
            $this->validateTypeId($type_id);
        }
        return $type_id;
    }