✨ Generate unique IDs (Port of Node package "generate-snowflake" to Golang)

✨ Generate Snowflake

Generate unique IDs. Inspired by Twitter's Snowflake system.

πŸ“¦ Installation

  • Initialize your project (go mod init example.com/example)
  • Add package (go get github.com/barbarbar338/snowflake)

πŸ€“ Usage

package main

import "github.com/barbarbar338/snowflake"

func main() {
    s := snowflake.Snowflake {
		EPOCH: 1618606800, // your projects EPOCH
	}

    id := s.Generate() // Some unique snowflake ID (eg: 6782465263234318336)
}

πŸ’» How It Works?

EPOCH: 1618606800
Snowflake: 6782465263234318336

Binary: 101111000100000001010000011100011001100100000100000000000000000
Timestamp: 1617065730866
WorkerID: 1
ProcessID: 0
Increment: 0

●------------------------------------------------------------------------●

β•”                                        Binary                          β•—
β•‘10111100010000000101000001110001100110010β•‘ β•‘00001β•‘ β•‘00000β•‘ β•‘000000000000β•‘
β•š               Timestamp                 ╝ β•š WID ╝ β•š PID ╝ β•š  Increment ╝

🧦 Contributing

Fell free to use GitHub's features.

Owner
Barış DEMİRCİ
Current temperature in Kayseri Province: 17.01Β°C / 16.31Β°C. Last edit: Sat, 05/29/21, 09:25:18 AM. Back-end developer with over 10 years experience. - he/him
Barış DEMİRCİ
Similar Resources

Generate UUID for script's sql

Generate UUID for script's sql Instale o go em sua maquina https://golang.org/doc/install Baixe as seguintes dependecias go get github.com/satori/go.u

Oct 26, 2021

A UUIDv4 generation package written in go

Goid A Go package to generate V4 UUIDs Documentation The API docs can be viewed here or generated with godoc. Usage An example of generating a v4 UUID

Dec 24, 2022

A UUID package originally forked from github.com/satori/go.uuid

UUID Package uuid provides a pure Go implementation of Universally Unique Identifiers (UUID) variant as defined in RFC-4122. This package supports bot

Dec 30, 2022

Go package for UUIDs based on RFC 4122 and DCE 1.1: Authentication and Security Services.

uuid The uuid package generates and inspects UUIDs based on RFC 4122 and DCE 1.1: Authentication and Security Services. This package is based on the g

Jan 1, 2023

UUID package for Go

UUID package for Go language This package provides pure Go implementation of Universally Unique Identifier (UUID). Supported both creation and parsing

Jan 2, 2023

An extremely fast UUID alternative written in golang

Overview WUID is a globally unique number generator, while it is NOT a UUID implementation. WUID is 10-135 times faster than UUID and 4600 times faste

Dec 9, 2022

An extremely fast UUID alternative written in golang

Overview WUID is a globally unique number generator, while it is NOT a UUID implementation. WUID is 10-135 times faster than UUID and 4600 times faste

May 10, 2021

❄ An Lock Free ID Generator for Golang based on Snowflake Algorithm (Twitter announced).

❄ An Lock Free ID Generator for Golang based on Snowflake Algorithm (Twitter announced).

❄ An Lock Free ID Generator for Golang based on Snowflake Algorithm (Twitter announced).

Dec 14, 2022

Golang wrapper for the Snowflake Api.

GoSnowflakeApi GoSnowflakeApi is an api wrapper for the snowflake api written in golang for golang developers. Example package main import ( "fmt

Jul 25, 2021
K-Sortable Globally Unique IDs

ksuid ksuid is an efficient, comprehensive, battle-tested Go library for generating and parsing a specific kind of globally unique identifier called a

Jan 9, 2023
A simple to use Go (golang) package to generate or parse Twitter snowflake IDs

snowflake snowflake is a Go package that provides A very simple Twitter snowflake generator. Methods to parse existing snowflake IDs. Methods to conve

Dec 30, 2022
Snowflake - A simple to use Go (golang) package to generate or parse Twitter snowflake IDs
Snowflake - A simple to use Go (golang) package to generate or parse Twitter snowflake IDs

❄️ Go-Snowflake A Snowflake Generator for Go A simple to use Go (golang) package

Oct 20, 2022
Snowflake - Simple twitter's snowflake uniquely identifiable descriptors (IDs) format generator for Go

Snowflake Dead simple and fast Twitter's snowflake id generator in Go. Installation go get github.com/HotPotatoC/snowflake Usage Generating a snowflak

Oct 6, 2022
A tiny and fast Go unique string generator

Nano ID A tiny and fast Go unique string generator Safe. It uses cryptographically strong random APIs and tests distribution of symbols. Compact. It u

Nov 11, 2022
Universally Unique Lexicographically Sortable Identifier (ULID) in Go

Universally Unique Lexicographically Sortable Identifier A Go port of alizain/ulid with binary format implemented. Background A GUID/UUID can be subop

Jan 9, 2023
High performance unique number generator powered by Go

SEQSVR High performance unique number generator powered by Go δΈ­ζ–‡ README Features Distributed: Can be scaled horizontally High performance: Allocation

Nov 16, 2022
A network service for generating unique ID numbers inspired by Twitter's Snowflake.

Hanabira Hanabira is a network service for generating unique ID numbers inspired by Twitter's Snowflake. How to run hanabira-cluster and etcd-cluster

Jan 13, 2022
Generate, encode, and decode UUIDs v1 with fast or cryptographic-quality random node identifier.

A Go package for generating and manipulating UUIDs Generate, encode, and decode UUIDs v1, as defined in RFC 4122, in Go. Project Status v1.1.0 Stable:

Sep 27, 2022
UUID package for Golang

UUID package for Go language This package provides pure Go implementation of Universally Unique Identifier (UUID). Supported both creation and parsing

Dec 9, 2021