From fcd79e7c1818a774434d24d1754e25359cd5c0ab Mon Sep 17 00:00:00 2001 From: Ben McIlwain Date: Thu, 19 Nov 2020 18:08:04 -0500 Subject: [PATCH] Add a full ASCII StringGenerator alphabet (#882) * Add a full ASCII StringGenerator alphabet This is intended for the purpose of generating maximally secure passwords for PostgreSQL and others. We may need to remove a few of these punctuation characters if they prove to be more trouble than they're worth (e.g. backtick). --- util/src/main/java/google/registry/util/StringGenerator.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/util/src/main/java/google/registry/util/StringGenerator.java b/util/src/main/java/google/registry/util/StringGenerator.java index ce12be3ee..10ce5bd43 100644 --- a/util/src/main/java/google/registry/util/StringGenerator.java +++ b/util/src/main/java/google/registry/util/StringGenerator.java @@ -39,6 +39,10 @@ public abstract class StringGenerator implements Serializable { /** Digit-only alphabet. */ public static final String DIGITS_ONLY = "0123456789"; + + /** Full ASCII alphabet with a wide selection of punctuation characters. */ + public static final String FULL_ASCII = + "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ`~!@#$%^&*()_-+={}[]\\/<>,.;?':| "; } protected String alphabet;