hashmap icon indicating copy to clipboard operation
hashmap copied to clipboard

Support compound keys

Open tredeske opened this issue 2 years ago • 0 comments

We would like to use struct keys, but do not need a general "supports all structs" approach being asked for in #53 . We can chain hashmaps together, but that is not a good solution for us.

In particular, we were wondering if a few new key types could be added.

type Key128 struct {
    One, Two uint64
}

This would be generally useful for a number of things such as IPv6 address lookups.

These next two would be useful for IPv6 + some other tuple information or two IPv6 addresses.

type Key192 struct {
    One, Two, Three uint64
}

type Key256 struct {
    One, Two, Three, Four uint64
}

tredeske avatar Oct 26 '22 19:10 tredeske