Uploaded image for project: 'Go Driver'
  1. Go Driver
  2. GODRIVER-2223

Use "math/rand" instead of "crypto/rand" for UUID generator

    • Type: Icon: Improvement Improvement
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 1.8.0
    • Affects Version/s: None
    • Component/s: None
    • None

      The "x/mongo/driver/uuid package currently uses "crypto/rand" as its randomness source for generating UUIDs. The cryptographically secure randomness source on some systems can be extremely slow. Also, the driver sessions specification specifically suggests using a pseudo-random number generator.

      See a CockroachDB discussion on "crypto/rand" performance for more context.

      Definition of done:

      • "x/mongo/driver/uuid uses "math/rand" instead of "crypto/rand".
      • "x/mongo/driver/uuid uses a package-specific random reader, not the global random reader.
      • Seed the "math/rand" pseudo-random number generator with the current time.

            Assignee:
            matt.dale@mongodb.com Matt Dale
            Reporter:
            matt.dale@mongodb.com Matt Dale
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: