Uploaded image for project: 'Commons RNG'
  1. Commons RNG
  2. RNG-59

More robust "SeedFactory"

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.0, 1.1
    • 1.2
    • simple
    • None

    Description

      SeedFactory will produce the same seed when several instances of the same program are launched in rapid successions.

      In the static block of SeedFactory, an initial "random" seed is generated using System.currentTimeMillis().

      I think that it should be replaced by retrieving data from a SecureRandom instance.
      The drawback is that instantiating such an object is necessary slower. However if it is the way to go (to ensure different initial seeds in parallel runs of a program), the question is whether to use only SecureRandom to create the (relatively large) state of the RNG used by the SeedFactory or to use it only to generate 8 bytes (and proceed with the rest of the static block as it is now).

      I'm planning to follow the advice here, i.e. fill the whole state with the system's default RNG.

      Attachments

        Activity

          People

            Unassigned Unassigned
            erans Gilles Sadowski
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: