Consolidate duplicate binary utility functions from bsoncore and wiremessage packages

XMLWordPrintableJSON

    • Type: Task
    • Resolution: Done
    • Priority: Unknown
    • 2.5.0
    • Affects Version/s: None
    • Component/s: None
    • None
    • Go Drivers
    • Not Needed
    • None
    • None
    • None
    • None
    • None
    • None

      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:

      1. AppendU32(dst []byte, u32 uint32) []byte
      2. AppendU64(dst []byte, u64 uint64) []byte
      3. ReadU32(src []byte) (uint32, []byte, bool)
      4. ReadU64(src []byte) (uint64, []byte, bool)
      5. ReadCString(src []byte) (string, []byte, bool)

      Pitfalls

      NA

            Assignee:
            Rafael Cenzano
            Reporter:
            Preston Vasquez
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: