old changes, idk (>1 year)
This commit is contained in:
1 parent
c5d6075c01
commit
ae18ac1ccd
120 files changed
+4011
-1138
No files matched your search
@@ -0,0 +1,17 @@
|
||||
package at.eisibaer.jbear2.util
|
||||
|
||||
import java.security.SecureRandom
|
||||
|
||||
|
||||
class RandomString{
|
||||
companion object{
|
||||
val AB: String = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"
|
||||
val rnd: SecureRandom = SecureRandom()
|
||||
|
||||
fun ofLength(len: Int): String {
|
||||
val sb = StringBuilder(len)
|
||||
for (i in 0 until len) sb.append(AB[rnd.nextInt(AB.length)])
|
||||
return sb.toString()
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user