cryptorandstr

package module
v1.0.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 16, 2024 License: MIT Imports: 3 Imported by: 0

README

crypto random string

Quickly generate secure random string.

Get

go get github.com/bddjr/cryptorandstr

Test

MustRand10 6
  227679
  901676
  193607
  026687
  243505

MustRand16 27
  017ced60ee75751a027605270fe
  2d89aa349e78988585524c5d074
  d155483394a0c8f75becd533faf
  7714135085cb7967f6ee645edb5
  0d0e22c51fe5cad882d6a0867d7

MustRand32 27
  5e9hoqmhspbsnng2ct2hgosko4e
  e9f5e7i5i24d9tlf1tef8fgcsba
  0dhkjpef6nqj1bnm81rhnjgjqjj
  kj968dr8sc9srpk9roj3go45k8r
  tvkb7pl542c3v5e3opqg5jcejhm

MustRand64 27
  xA-ZoFjHgQ927Jxnhly7WWRMvjw
  NIBvnag5JrYhvHZ-NaKEZkmBgco
  YD3qxeMe7AGlXllP0M07GkTXnMA
  fC7_-XWOEf-BPv-U5_bRXrkEDqi
  b1t6xZLgmW2v9KdxGEKqVIp-WAH

PASS
ok      github.com/bddjr/cryptorandstr  0.034s

License

MIT

Documentation

Index

Constants

View Source
const Chars64 = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-_"

Variables

View Source
var Chars10 = Chars64[:10]
View Source
var Chars16 = Chars64[:16]
View Source
var Chars32 = Chars64[:32]

Functions

func MustRand

func MustRand(strLen int, chars string) string

Panic when error.

func MustRand10

func MustRand10(strLen int) string

Panic when error.

func MustRand16

func MustRand16(strLen int) string

Panic when error.

func MustRand32

func MustRand32(strLen int) string

Panic when error.

func MustRand64

func MustRand64(strLen int) string

Panic when error.

func Rand

func Rand(strLen int, chars string) (string, error)

func Rand10

func Rand10(strLen int) (string, error)

func Rand16

func Rand16(strLen int) (string, error)

func Rand32

func Rand32(strLen int) (string, error)

func Rand64

func Rand64(strLen int) (string, error)

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL