All Projects → dchest → Uniuri

dchest / Uniuri

Licence: cc0-1.0
Go package uniuri generates random strings good for use in URIs to identify unique objects.

Programming Languages

go
31211 projects - #10 most used programming language
golang
3204 projects

Projects that are alternatives of or similar to Uniuri

secrets.clj
A library designed to generate cryptographically strong random numbers.
Stars: ✭ 64 (-80.95%)
Mutual labels:  uuid, random, secure
Random compat
PHP 5.x support for random_bytes() and random_int()
Stars: ✭ 7,950 (+2266.07%)
Mutual labels:  random, secure
Session Token
Secure, efficient, simple random session token generation
Stars: ✭ 12 (-96.43%)
Mutual labels:  random, uuid
Nanoid
A tiny, secure, URL-friendly, unique string ID generator for Rust
Stars: ✭ 188 (-44.05%)
Mutual labels:  random, uuid
Kirby3 Autoid
Automatic unique ID for Pages, Files and Structures including performant helpers to retrieve them. Bonus: Tiny-URL.
Stars: ✭ 58 (-82.74%)
Mutual labels:  random, uuid
ruuid
A fast uuid generator in Python using Rust
Stars: ✭ 19 (-94.35%)
Mutual labels:  uuid, random
terraform-provider-random
Supports the use of randomness within Terraform configurations. This is a logical provider, which means that it works entirely within Terraform logic, and does not interact with any other services. This provider is maintained by the HashiCorp Terraform team.
Stars: ✭ 109 (-67.56%)
Mutual labels:  random
falso
All the Fake Data for All Your Real Needs 🙂
Stars: ✭ 877 (+161.01%)
Mutual labels:  random
SharpLoader
🔮 [C#] Source code randomizer and compiler
Stars: ✭ 36 (-89.29%)
Mutual labels:  random
drive-mobile
internxt.com
Stars: ✭ 43 (-87.2%)
Mutual labels:  secure
Markovnamegenerator
✒️ Markov process-based procedural name and word generator
Stars: ✭ 300 (-10.71%)
Mutual labels:  random
Vinyldns
DNS Governance for streamlining DNS operations and enabling safe and secure DNS self-service
Stars: ✭ 293 (-12.8%)
Mutual labels:  secure
httpshell
SSH like Shell via http protocol
Stars: ✭ 13 (-96.13%)
Mutual labels:  secure
random-in
Get Random Numbers, Names, Dates and much more.
Stars: ✭ 15 (-95.54%)
Mutual labels:  random
Newid
A sequential id generator that works across nodes with no collisions
Stars: ✭ 255 (-24.11%)
Mutual labels:  uuid
sha-2
SHA-2 algorithm implementations
Stars: ✭ 122 (-63.69%)
Mutual labels:  secure
Nova Permission
A Laravel Nova tool for Spatie's laravel-permission library
Stars: ✭ 294 (-12.5%)
Mutual labels:  secure
fastrand
10x faster than crypto/rand
Stars: ✭ 76 (-77.38%)
Mutual labels:  random
lethe
Secure drive wipe
Stars: ✭ 47 (-86.01%)
Mutual labels:  secure
Provisioning
Kubernetes cluster provisioning using Terraform.
Stars: ✭ 277 (-17.56%)
Mutual labels:  secure

Package uniuri

Build Status

import "github.com/dchest/uniuri"

Package uniuri generates random strings good for use in URIs to identify unique objects.

Example usage:

s := uniuri.New() // s is now "apHCJBl7L1OmC57n"

A standard string created by New() is 16 bytes in length and consists of Latin upper and lowercase letters, and numbers (from the set of 62 allowed characters), which means that it has ~95 bits of entropy. To get more entropy, you can use NewLen(UUIDLen), which returns 20-byte string, giving ~119 bits of entropy, or any other desired length.

Functions read from crypto/rand random source, and panic if they fail to read from it.

Constants

const (
	// StdLen is a standard length of uniuri string to achive ~95 bits of entropy.
	StdLen = 16
	// UUIDLen is a length of uniuri string to achive ~119 bits of entropy, closest
	// to what can be losslessly converted to UUIDv4 (122 bits).
	UUIDLen = 20
)

Variables

var StdChars = []byte("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789")

StdChars is a set of standard characters allowed in uniuri string.

Functions

func New

func New() string

New returns a new random string of the standard length, consisting of standard characters.

func NewLen

func NewLen(length int) string

NewLen returns a new random string of the provided length, consisting of standard characters.

func NewLenChars

func NewLenChars(length int, chars []byte) string

NewLenChars returns a new random string of the provided length, consisting of the provided byte slice of allowed characters (maximum 256).

Public domain dedication

Written in 2011-2014 by Dmitry Chestnykh

The author(s) have dedicated all copyright and related and neighboring rights to this software to the public domain worldwide. Distributed without any warranty. http://creativecommons.org/publicdomain/zero/1.0/

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].