Git Product home page Git Product logo

uniq's Introduction

๐ŸŒณ Go Unique Identifiers

GoDoc License

Package uniq is a utility package and Bonzai command branch that provides common random unique identifiers in UUID, Base32, and n*2 random hexadecimal characters.

6c671957-2f39-4ce5-9f0e-e8d5ec53bfde (16 bytes, 36 chars, hex-)
H6M0STKP0MTSU0493GERQDCSJ5BMF3VO     (20 bytes, 32 chars, base32)
5b ...                               (n bytes, n*2 chars, hex)

When a simple random identifier is all that is needed Base32() provides a better alternative to UUID(). It takes less space (32 characters), is safe for use with all file systems including case insensitive ones, and provides additional randomness increased from 2^128 (UUID) to 2^160 (Base32).

This package includes the following convenience commands as well for use when integrating with shell scripts:

  • uuid
  • uid32
  • isosec
  • isosect
  • epoch [SECONDS]
  • randhex [COUNT]

Install

This command can be installed as a standalone program or composed into a Bonzai command tree.

Standalone

go install github.com/rwxrob/uniq/cmd/uniq@latest

Composed

package z

import (
	Z "github.com/rwxrob/bonzai"
	"github.com/rwxrob/uniq"
)

var Cmd = &Z.Cmd{
	Name:     `z`,
	Commands: []*Z.Cmd{help.Cmd, uniq.Cmd},
}

Tab Completion

To activate bash completion just use the complete -C option from your .bashrc or command line. There is no messy sourcing required. All the completion is done by the program itself.

complete -C uniq uniq

If you don't have bash or tab completion check use the shortcut commands instead.

Embedded Documentation

All documentation (like manual pages) has been embedded into the source code of the application. See the source or run the program with help to access it.

uniq's People

Contributors

rwxrob avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

Forkers

playfloor

uniq's Issues

`go install` fails: module found, but does not contain package

[hayden@hbjy-pc ~]$ go install github.com/rwxrob/uniq/uniq@latest
go: github.com/rwxrob/uniq/uniq@latest: module github.com/rwxrob/uniq@latest found (v0.4.2), but does not contain package github.com/rwxrob/uniq/uniq
[hayden@hbjy-pc ~]$ go install github.com/rwxrob/uniq/cmd/uniq@latest
go: github.com/rwxrob/uniq/cmd/uniq@latest: module github.com/rwxrob/uniq@latest found (v0.4.2), but does not contain package github.com/rwxrob/uniq/cmd/uniq

I'm on Fedora but I installed Go 1.18 from source with GVM.

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.