Changeset 396
- Timestamp:
- Feb 22, 2010, 11:10:34 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/grails-app/services/AuthService.groovy
r291 r396 32 32 } 33 33 34 /** 35 * Generate a random password. 36 * @returns The generated password. 37 */ 38 def getRandomPassword() { 39 def passwd = "" 40 def pool = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_" 41 def rand = new Random(System.currentTimeMillis()) 42 43 for(i in 0..10) 44 passwd += pool[rand.nextInt(pool.length())] 45 46 return passwd 47 } 48 34 49 }
Note: See TracChangeset
for help on using the changeset viewer.