Skip to content

A CLI that can help generate random string that can be use in for token, random password generate etc.

License

Notifications You must be signed in to change notification settings

arifmahmudrana/rand-str

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Tag and release Go Report Card codecov

Random string generator

This CLI allows random string easyly from string set with given size.

Releases

To run this CLI go to releases and find the appropriate build from release page.

Usage

To run command first grab an executable from release.

~ rand-str --help # For help or rand-str -h
# Outputs
# usage: main <string_len> <string_set>

~ rand-str 6 # For random string of 6 characters
~ rand-str 9 "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz" # For random string of 9 characters from "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz" set

Test

To run tests locally make sure

  • Need Go 1.16
  • Setup project or clone outside GOPATH to check run go env GOPATH

To run test

go test -v -race ./...

To get test coverage

go test -v -race -coverprofile=/tmp/go-cover.`basename $(pwd)`.out -covermode=atomic ./... && go tool cover -func=/tmp/go-cover.`basename $(pwd)`.out && unlink /tmp/go-cover.`basename $(pwd)`.out

Or

go test -v -race -coverprofile=/tmp/go-cover.`basename $(pwd)`.out -covermode=atomic ./... && go tool cover -html=/tmp/go-cover.`basename $(pwd)`.out && unlink /tmp/go-cover.`basename $(pwd)`.out

Build

First clone the repo then follow the Tests step.

go build

Contributing

First clone the repo then follow the Tests step.

We use svu for automatic tagging and build of our repo using Github actions see svu commit message pattern for your commit message.

About

A CLI that can help generate random string that can be use in for token, random password generate etc.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages