Context
The x/bsonx/bsoncore and x/mongo/driver/wiremessage packages both contain duplicate implementations of low-level binary operations that should be centralized.
Definition of done
Add the following functions to binaryutil internal package and remove their analogues in wiremessage and bsoncore packages:
- AppendU32(dst []byte, u32 uint32) []byte
- AppendU64(dst []byte, u64 uint64) []byte
- ReadU32(src []byte) (uint32, []byte, bool)
- ReadU64(src []byte) (uint64, []byte, bool)
- ReadCString(src []byte) (string, []byte, bool)
Pitfalls
NA