Tiny Go package to just generate secure random bytes or strings with fixed length.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Jose Quintana b3b1734659
docs: add package doc
2 weeks ago
.vscode test: ensure length result 3 weeks ago
.gitignore init 3 weeks ago
.travis.yml init 3 weeks ago
LICENSE-APACHE init 3 weeks ago
LICENSE-MIT init 3 weeks ago
Makefile init 3 weeks ago
README.md init 3 weeks ago
go.mod init 3 weeks ago
strand.go docs: add package doc 2 weeks ago
strand_test.go feat: check to prevent minor length great or equal then zero 2 weeks ago

README.md

Strand Build Status codecov Go Report Card GoDoc

Tiny package to just generate secure random bytes and strings.

Supported Go versions

  • 1.10.3+
  • 1.11+

Usage

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 or issue.

License

This work is primarily distributed under the terms of both the MIT license and the Apache License (Version 2.0).

© 2019 Jose Quintana