doc: update doc for RandNumberOfLength and GetExeOrDllVersion

This commit is contained in:
dudaodong committed 2024-10-18 16:38:39 +08:00
1 parent ed93aae970
commit 0a2cc9c928
10 files changed
+86 -24

No files matched your search

+4 -3
View File
@@ -328,11 +328,12 @@ func UUIdV4() (string, error) {
return fmt.Sprintf("%x-%x-%x-%x-%x", uuid[0:4], uuid[4:6], uuid[6:8], uuid[8:10], uuid[10:]), nil
}
// RandNumLen 生成一个长度为len的随机数
// Play: https://go.dev/play/p/jpIalcD5rMo
func RandNumLen(len int) int {
// RandNumberOfLength 生成一个长度为len的随机数
// Play: todo
func RandNumberOfLength(len int) int {
m := int(math.Pow10(len) - 1)
i := int(math.Pow10(len - 1))
ret := rand.Intn(m-i+1) + i
return ret
}