// Copyright 2022 Martin Dosch. // Use of this source code is governed by the BSD-2-clause // license that can be found in the LICENSE file. package main import ( "crypto/rand" "fmt" "log" mrand "math/rand" "time" ) func getRpad() string { var letters = []rune("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789.,;?!+-_ยง$%&/()=") mrand.Seed(time.Now().UnixNano()) s := make([]rune, mrand.Intn(30)+20) for i := range s { s[i] = letters[mrand.Intn(len(letters))] } return string(s) } func getID() string { b := make([]byte, 12) _, err := rand.Read(b) if err != nil { log.Fatal(err) } id := fmt.Sprintf("%x-%x-%x", b[0:4], b[4:8], b[8:]) return id }