diff options
| author | b5f0d6c3 <[email protected]> | 2022-05-06 10:46:55 +0800 |
|---|---|---|
| committer | b5f0d6c3 <[email protected]> | 2022-05-06 10:46:55 +0800 |
| commit | 79f40d4f7bedf2554d072f6ded4eb73373dd7319 (patch) | |
| tree | bef73cc28e3800ec02d3764302eddbc601ff8d8c /mkvtool/utils.go | |
| parent | 8c382de8c87260d68b9c10e2bf687cbd53e3beb8 (diff) | |
update
Diffstat (limited to 'mkvtool/utils.go')
| -rw-r--r-- | mkvtool/utils.go | 28 |
1 files changed, 0 insertions, 28 deletions
diff --git a/mkvtool/utils.go b/mkvtool/utils.go index 95bdbfb..e60afe8 100644 --- a/mkvtool/utils.go +++ b/mkvtool/utils.go @@ -2,12 +2,10 @@ package main import ( "errors" - "math/rand" "os" "path/filepath" "regexp" "strings" - "time" ) func queryPath(path string, cb func(string) bool) error { @@ -50,29 +48,3 @@ func splitPath(p string) (dir, name, ext, namewithoutext string) { } return } - -var r = rand.New(rand.NewSource(time.Now().UnixNano())) - -func randomN(n int) int { - return r.Intn(n) -} - -func randomNumber(min, max int) int { - sub := max - min + 1 - if sub <= 1 { - return min - } - return min + randomN(sub) -} - -func randomStr(l int) string { - str := "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ" - bytes := []byte(str) - var result []byte - lstr := len(str) - 1 - for i := 0; i < l; i++ { - n := randomNumber(0, lstr) - result = append(result, bytes[n]) - } - return string(result) -} |
