shortulid

package module
v0.0.0-...-7f64952 Latest Latest
Warning

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

Go to latest
Published: Jul 9, 2021 License: MIT Imports: 6 Imported by: 0

README

This repository is an experiment for me to create a "shorter" ulid.

Why I want this:

  • I want some of the features of ULID
    • Lexicographically Sortable Identifier
  • ULID is long at 26 characters
    • I want something shorter, say 9 characters
    • To be used as "order ids"
  • I don't need millisecond support
  • I don't need as much entropy as ULID
  • I don't need support till 10889 AD

Do not use this if you need a lot of entropy.

ULID shortulid
Characters 26 9
Characters reserved for time 10 6
Characters reserved for entropy 16 3
Support till Year 10889 2054
Bits of entropy 80 15
Precision millisecond second

Also See:

Documentation

Overview

Taken from https://stackoverflow.com/a/31832326

Index

Constants

This section is empty.

Variables

View Source
var EPOCH = time.Date(2020, 1, 1, 0, 0, 0, 0, time.UTC).Unix()

Functions

func New

func New() string

func RandStringBytesMaskImprSrcUnsafe

func RandStringBytesMaskImprSrcUnsafe(n int) string

Types

This section is empty.

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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