PKSUID is a small extension for KSUID (K-Sortable Globally Unique IDs) which allows prefixing it with arbitrary up to 16 bytes strings

PKSUID - KSUID with arbitrary string prefix

PKSUID is a small extension of the KSUID (K-Sortable Globally Unique IDs) https://github.com/segmentio/ksuid which allows prefixing KSUID with the 16 bytes arbitrary string to achieve the following kind of the identifiers:

user:208AocW9380pRVFbQ6sj6Oofu0w
product:208BJB4ntOzehBIADBW6h69juir
anything208BLsTohQ0OnynbQxoeyoRu086

Stripe uses this kind of identifier.

Why using the prefix?

The prefix part might carry additional information valuable for an application. For example the one can indicate the polymorphic relationship of a resource using an identifier with a prefix.

If you don't need prefixes, we strongly recommend using KSUID

Example

	userPrefix := pksuid.Prefix{'u', 's', 'e', 'r', ':'}
	id := pksuid.New(userPrefix)

	fmt.Println(id)
	// prints something like this: user:208ETB1zVhm50luzEgNAnLRNQZE

	id2, _ := pksuid.Parse("user:208ETB1zVhm50luzEgNAnLRNQZE")
	fmt.Println(id2.Prefix())
	fmt.Println(id2.Prefix() == userPrefix)
	fmt.Println(id2.ID())
	// user:208Np9GX0sC0J42peUKj4nW1CW9
	// user:
	// true
	// 208ETB1zVhm50luzEgNAnLRNQZE
Owner
Velmie
Blockchain & Cryptocurrency Solutions.
Velmie
Similar Resources

Package fsm allows you to add finite-state machines to your Go code.

fsm Package fsm allows you to add finite-state machines to your Go code. States and Events are defined as int consts: const ( StateFoo fsm.State =

Dec 9, 2022

The kprobe package allows construction of dynamic struct based on kprobe event format descriptions.

The kprobe package allows construction of dynamic struct based on kprobe event format descriptions.

Oct 27, 2021

Joy2Mouse is a program that allows you to control your computer mouse with a joystick.

Joy2Mouse is a program that allows you to control your computer mouse with a joystick.

Joy2Mouse Joy2Mouse is a program that allows you to control your computer mouse with a joystick. Features Control your mouse with a joystick Mouse dow

Dec 26, 2021

This application is a tool that allows you to prepare mail designs specific to your group and make Christmas raffles.

What is this? This application is a tool that allows you to prepare mail designs specific to your group and make Christmas raffles. How is it working?

Dec 15, 2022

Works with HashiCorp HCL. Allows to append the input file with blocks and attributes from the template file

About hclmergetool Works with HashiCorp HCL. Allows to append the input file with blocks and attributes from the template file Installation Binary Rel

Feb 6, 2022

Allows verifying client's phone number

hone verification module for Elling - Elytrium Billing

Jun 4, 2022

Small proof of concept project to try temporal.io with Dispatch Incident Management from Netflix.

Small proof of concept project to try temporal.io with Dispatch Incident Management from Netflix.

temporal-dispatch-poc Small POC project to try out the Temporal workflow engine together with Netflix's Dispatch Incident Management System. Supported

Nov 12, 2021

A small web dashboard with stats for all pipelines of Buildkite organization.

A small web dashboard with stats for all pipelines of Buildkite organization.

Buildkite Stats A small Buildkite dashboard useful to prioritize which pipelines a Buildkite organization is waiting the most on. Noteworthy details:

Apr 25, 2022

A small API to be used in Traefik Forward Auth to block attacks on services behind your favorite web router

Dynamic IPs Blacklist for Traefik This small software implements the possibility to block access to all the services behind your Traefik service. The

Sep 2, 2022
Related tags
A go module for "friendly" IDs

go-eyed A go module for "friendly" IDs. THIS MODULE IS INCOMPLETE AND NOT CURRENTLY BEING MAINTAINED. THEREFORE, IT SHOULD NOT BE USED Contribution If

Dec 17, 2021
A Go package to allow you to read and write from the serial port as a stream of bytes.

Serial A Go package to allow you to read and write from the serial port as a stream of bytes. Details It aims to have the same API on all platforms, i

Jan 6, 2023
A distributed unique ID generator of using Sonyflake and encoded by Base58

Indigo About A distributed unique ID generator of using Sonyflake and encoded by Base58. ID max length is 11 characters by unsigned int64 max value. A

Nov 24, 2022
A Golang library to manipulate strings according to the word parsing rules of the UNIX Bourne shell.

shellwords A Golang library to manipulate strings according to the word parsing rules of the UNIX Bourne shell. Installation go get github.com/Wing924

Sep 27, 2022
Find strings in Go binaries

gostringsr2 gostringsr2 extracts strings from a Go binary using radare2. Tested with radare2 3.7.0, Python 3.7, r2pipe 1.4.1, on OS X and Linux. Teste

Oct 20, 2022
repin is a tool to replace strings between keyword pair.

repin repin is a tool to replace strings between keyword pair. tl;dr repin is a tool that makes it easy to write operations that can be written in GNU

Nov 4, 2022
Filter out multiple strings from stdin.

minus The minus tool accepts data from stdin and filters out any arguments passed. It simplifies something like this: some_command | grep -vF thing1 |

Dec 20, 2021
Third party extension interface for sillyGirl.
Third party extension interface for sillyGirl.

Third party extension interface for sillyGirl.

Jan 11, 2022
As the name says. Forges badge responses for the Defcon 29 badge and allows folks to jump straight to having completed the signal.

Defcon 29 Badge Code Generator Exactly as the title says. Will generate 7 signal keys to get you to signal then will generate 20 keys to distribute th

Aug 25, 2021
Allows you to swap usernames at https://solo.to, I swapped @/city and @/lose with this program :)
Allows you to swap usernames at https://solo.to, I swapped @/city and @/lose with this program :)

Solo.To-Username-Swapper added the exe version for people who do not have Go installed, how ever I reccomend installing it at https://golang.org Getti

Sep 29, 2021