1
0
mirror of https://github.com/lus/pasty.git synced 2023-08-10 21:13:09 +03:00

restructure startup & config logic

This commit is contained in:
Lukas Schulte Pelkum
2023-06-07 17:46:19 +02:00
parent e93b292daf
commit 3575c02c1e
21 changed files with 175 additions and 1412 deletions

14
internal/randx/string.go Normal file
View File

@@ -0,0 +1,14 @@
package randx
import (
"math/rand"
)
// String returns a random string with the given length
func String(characters string, length int) string {
bytes := make([]byte, length)
for i := range bytes {
bytes[i] = characters[rand.Int63()%int64(len(characters))]
}
return string(bytes)
}