public function build(int $shard_id, int $type_id, int $local_id, bool $validate = true): int
    {
        if ($validate) {
            $this->validateShardId($shard_id);
            $this->validateTypeId($type_id);
            $this->validateLocalId($local_id);
        }
        return (0 << (64 - 2))
            | ($shard_id << (64 - 2 - 16))
            | ($type_id << (64 - 2 - 16 - 8))
            | ($local_id << (64 - 2 - 16 - 8 - 38));
    }