In the GCP bootstrap script I am currently developing, I have a need to generate a random string that I can use as a unique identifier for seeding the Project ID when creating a new project. I haven't seen us provide this as a library outside of terratest, so I ported a version of random.UniqueId here that is more generic, where you can control char sets and digits.
Note that this uses crypto/rand instead of math/rand, to allow for potential usage with password generation.
In the GCP bootstrap script I am currently developing, I have a need to generate a random string that I can use as a unique identifier for seeding the Project ID when creating a new project. I haven't seen us provide this as a library outside of
terratest
, so I ported a version ofrandom.UniqueId
here that is more generic, where you can control char sets and digits.Note that this uses
crypto/rand
instead ofmath/rand
, to allow for potential usage with password generation.