diff --git a/README.md b/README.md index d2c0791..7bf394e 100644 --- a/README.md +++ b/README.md @@ -61,5 +61,31 @@ Running example // kDX1m81u14YwEiCY ``` +### Generate a random number string +```go +token := randstr.String(16) // generate a random 16 length string of number +``` +Running example +```go + package main + import( + "github.com/thanhpk/randstr" + "fmt" + ) + + func main() { + for i := 0; i < 5; i++ { + token := randstr.Number(16) + fmt.Println(token) + } + } + // Output: + //1232392418047380 + //9160917876815937 + //6629264107419930 + //0271037110897873 + //0337735480322223 +``` + ## License [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) MIT