Coder Social home page Coder Social logo

grand's Introduction

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=

grand's People

Contributors

soroushj avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.