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

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

    XMLWordPrintableJSON

Details

    • Icon: Improvement Improvement
    • Resolution: Fixed
    • Icon: Major - P3 Major - P3
    • 1.8.0
    • None
    • None
    • None

    Description

      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.

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: