Skip to content

Commit

Permalink
gf-doc up
Browse files Browse the repository at this point in the history
  • Loading branch information
gqcn committed Oct 23, 2018
1 parent c04adfc commit 4984889
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions util/grand/index.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# grand

`grand`模块实现了对随机数操作的封装和改进,提供了极高的随机数生成性能,并保证每一次调用随机方法时生成的都是不同的随机数值。

使用方式:
```go
import "gitee.com/johng/gf/g/util/grand"
Expand All @@ -12,4 +14,13 @@ func RandDigits(n int) string
func RandLetters(n int) string
func RandStr(n int) string
func Seed(seed ...int64)
```

基准测试:
```html
goos: linux
goarch: amd64
pkg: gitee.com/johng/gf/g/util/grand
Benchmark_Rand-4 20000000 68.1 ns/op
PASS
```

0 comments on commit 4984889

Please sign in to comment.