Class RandomStringGenerator

java.lang.Object
google.registry.util.StringGenerator
google.registry.util.RandomStringGenerator
All Implemented Interfaces:
Serializable

public class RandomStringGenerator extends StringGenerator
Random string generator.
See Also:
  • Constructor Details

    • RandomStringGenerator

      public RandomStringGenerator(String alphabet, SecureRandom random)
  • Method Details

    • createString

      public String createString(int length)
      Generates a random string of a specified length.
      Specified by:
      createString in class StringGenerator
    • insecureRandomStringGenerator

      public static RandomStringGenerator insecureRandomStringGenerator(String alphabet)
      Returns an instance of this class backed by an insecure random number generator.

      This is good for generating non-critical data at high throughput, e.g., log traces.