Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP


generate a random string #42

pk11 opened this Issue · 5 comments

2 participants


Hi Nathan,

g8 is awesome, we have just one issue.

in play apps, there is a configuration field called application.secret that lets you define your app's private key which is used for security.

Right now what we do is create a variable (application_secret) with the value CHANGEME12345678 but what would be great is to be able to generate a random string like

  val random = new
  val newSecret = (1 to 64).map { _ =>
    (random.nextInt(74) + 48).toChar
  }.mkString.replaceAll("\\\\+", "/")

for a special key $RANDOM$

or if that's breaking the current design then defining a formatter called random which would attach a random string to your base string would also be perfect!


(I can send a pull request if needed for the random formatter solution)


yeah a pull request will make it happen faster :)


I just sent you a pull request, hope it looks OK. Thanks!


Thanks, I just added this to the readme:

random | generate-random : appends random characters to the given string

@n8han n8han closed this

excellent - thanks Nathan!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.