https://github.com/joseluisq/strand
Tiny package to just generate secure random bytes or strings with fixed length.
https://github.com/joseluisq/strand
golang golang-crypto golang-package random-bytes random-string
Last synced: 10 months ago
JSON representation
Tiny package to just generate secure random bytes or strings with fixed length.
- Host: GitHub
- URL: https://github.com/joseluisq/strand
- Owner: joseluisq
- License: apache-2.0
- Created: 2019-10-22T21:34:21.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2019-10-23T21:37:10.000Z (over 6 years ago)
- Last Synced: 2024-04-22T14:23:25.160Z (almost 2 years ago)
- Topics: golang, golang-crypto, golang-package, random-bytes, random-string
- Language: Go
- Homepage:
- Size: 11.7 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE-APACHE
Awesome Lists containing this project
README
# Strand [](https://travis-ci.com/joseluisq/strand) [](https://codecov.io/gh/joseluisq/strand) [](https://goreportcard.com/report/github.com/joseluisq/strand) [](https://godoc.org/github.com/joseluisq/strand)
> Tiny package to just generate [secure](https://golang.org/pkg/crypto/rand/) random bytes and strings.
## Supported Go versions
- 1.10.3+
- 1.11+
## Usage
```go
package main
import (
"fmt"
"github.com/joseluisq/strand"
)
func main() {
str, err := strand.randomString(32)
if err != nil {
panic(err)
}
fmt.Println("Result: ", str)
// Result: 55b3b071fb00e08460639c05f5ba3ef0
}
```
## Contributions
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in current work by you, as defined in the Apache-2.0 license, shall be dual licensed as described below, without any additional terms or conditions.
Feel free to send some [Pull request](https://github.com/joseluisq/strand/pulls) or [issue](https://github.com/joseluisq/strand/issues).
## License
This work is primarily distributed under the terms of both the [MIT license](LICENSE-MIT) and the [Apache License (Version 2.0)](LICENSE-APACHE).
© 2019 [Jose Quintana](http://git.io/joseluisq)