## Summary
HTTPFields equality does not depend on the order of differently named
fields. Hashing used storage order, so equal values could hash
differently.
This hashes each name group in relative order, then mixes those group
hashes without depending on name order. The existing hash test now
asserts equal hashes.
Fixes#139
### Motivation
HTTP/2 and HTTP/3 both carry a numeric error code to say why a stream or
a connection was terminated. HTTPTypes has no currency type for either,
so adopters passed bare integers around or defined their own.
### Modifications
Add HTTP2ErrorCode and HTTP3ErrorCode.
### Result
HTTP/2 and HTTP/3 error codes are first-class currency types.
---------
Co-authored-by: Fabian Fett <fabianfett@apple.com>
### Motivation
#138 introduced code paths that scale quadratically when running an
equality check.
### Changes
- Introduce a new lock-step equality check that performs great for small
fields and fields that share roughly the same order
- Introduce a new lookup equality check that scales linear for vastly
different field orders
### Result
Faster equality checks
### Motivation
We like faster and simpler code. When optimizing performance we focus on
often used use-cases.
### Changes
- Reimplement HTTPFields on top of a simple Array
### Result
- HTTPFields building becomes significantly faster
- HTTPFields lookups are faster for small fields, and only slightly
slower for larger (nearly always offset by reduced build time)
Follow ups:
- Make the equality implementation smarter
### Motivation
The more we test the more we know about current behavior
### Changes
- Add tests for hashing, incl. a failing one
### Result
We know that our hash implementation isn't respecting different header
order
### Motivation
We want to refactor some internals of this library. For this we need
tests. The existing tests are written with XCTest. Given that the total
number of test is relatively small, let's take the chance and move to
swift-testing before we add further tests.
### Changes
- Move all tests from XCTest to swift-testing
- This is a mechanical change
### Result
All tests use the test framework of the future.
# Motivation
We just adopted GH actions and want to make sure all the CI checks are green.
# Modification
This PR makes the necessary changes to pass all checks. Including:
- Adding a licenseignore file
- Moving `swift-format` and adopting the config that we use in all other swift on server repos.
# Result
Green CI.