Debian Codegraph @

util.go

raw symbols SCIP
1 package gosubmit
2
3 import (
4 "math/rand"
5 "strconv"
6 "strings"
7 "time"
8 )
9
10 func atoi(str string) int {
11 value, _ := strconv.Atoi(str)
12 return value
13 }
14
15 func itoa(value int) string {
16 return strconv.Itoa(value)
17 }
18
19 const letters = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
20
21 var randomSource = rand.NewSource(time.Now().UnixNano())
22
23 func randomString(size int) string {
24 lettersCount := len(letters)
25 var b strings.Builder
26 b.Grow(size)
27 for i := 0; i < size; i++ {
28 index := rand.Intn(lettersCount)
29 b.WriteByte(letters[index])
30 }
31 return b.String()
32 }