grand

command module
v0.0.0 Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2024 License: MIT Imports: 11 Imported by: 0

README

grand - CLI tool for generating cryptographically-secure random byte strings

Installation

go install github.com/soroushj/grand@latest

Usage

grand [flags]

The flags are:

-e encoding
    output encoding; one of:
      "hex"   - base16
      "b64s"  - base64, standard alphabet
      "b64sr" - base64, standard alphabet, no padding
      "b64u"  - base64, URL-safe alphabet
      "b64ur" - base64, URL-safe alphabet, no padding
      "b32s"  - base32, standard alphabet
      "b32sr" - base32, standard alphabet, no padding
      "b32h"  - base32, extended hex alphabet
      "b32hr" - base32, extended hex alphabet, no padding
      (default "hex")
-n int
    number of random byte strings to generate (default 1)
-s size
    size of random byte strings; an integer or an inclusive range,
    e.g. "16-32" (if a range is specified, the size of each byte
    string will be a cryptographically-secure random number in the
    range) (default "16")

An example for generating two 32-byte base64url-encoded random byte strings:

$ grand -e b64u -s 32 -n 2
8cYgWnTqRq1RkDJBB-PKnf1pp7svVox_c0bR8lqctIM=
5XzQ2In5cO2Rz5GD8VcHwJJZFS7iCXydbdEbnyVLfJE=

Documentation

Overview

Grand generates cryptographically-secure random byte strings.

Usage:

grand [flags]

The flags are:

-e encoding
    output encoding; one of:
      "hex"   - base16
      "b64s"  - base64, standard alphabet
      "b64sr" - base64, standard alphabet, no padding
      "b64u"  - base64, URL-safe alphabet
      "b64ur" - base64, URL-safe alphabet, no padding
      "b32s"  - base32, standard alphabet
      "b32sr" - base32, standard alphabet, no padding
      "b32h"  - base32, extended hex alphabet
      "b32hr" - base32, extended hex alphabet, no padding
      (default "hex")
-n int
    number of random byte strings to generate (default 1)
-s size
    size of random byte strings; an integer or an inclusive range,
    e.g. "16-32" (if a range is specified, the size of each byte
    string will be a cryptographically-secure random number in the
    range) (default "16")

Jump to

Keyboard shortcuts

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