Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/andrewfrench/rand
Applied randomness.
https://github.com/andrewfrench/rand
Last synced: about 9 hours ago
JSON representation
Applied randomness.
- Host: GitHub
- URL: https://github.com/andrewfrench/rand
- Owner: andrewfrench
- Created: 2019-12-01T22:29:50.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2023-10-04T04:28:54.000Z (about 1 year ago)
- Last Synced: 2024-06-20T12:46:54.180Z (5 months ago)
- Language: Go
- Homepage:
- Size: 11.7 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# rand
A random string and number generation utility.
By default, `rand` will output an eight-character string containing characters `a-z0-9`. If any of the source modifiers `-l`, `-u`, `-n`, or `-s` are specified, the source will only include the character types requested. Hide the output with `-b`, which copies the output to the clipboard. The length of the output string can be specified using `-c` without altering the character source.
In password mode (`-p` or `--password`), `rand` will generate a 32-character string from all sources. This mode is equivalent to `rand -lunsbc32`. Password mode will override all other modifiers and send the output to the clipboard for security.
### Usage
`rand [flags]`
#### Examples
```
$ rand
6agqlqrl
``````
$ rand -luns
F##iPSJt
``````
$ rand -nuc20
Q1XH3E6EQ4A0EHEKUVDZ
``````
$ rand -c3
w1p
``````
$ rand -p
Copied value to clipboard.
```#### Flags
`-h`, `--help` help for rand
`-c`, `--len int` sets the length, in characters, of the output (default 8)
`-l`, `--lowers` include lowercase letters a-z
`-n`, `--numbers` include numerals 0-9
`-p`, `--password` generate a password string
`-s`, `--specials` include special characters like !, @, and #
`-u`, `--uppers` include uppercase letters A-Z
`-b`, `--clipboard` copy the output to the clipboard
### Build
```sh
make build
```### Install
If the repository is cloned locally:
```sh
make install
```