Snowflake algorithm generation worker Id sequence

sequence

snowflake algorithm generation worker Id sequence 使用雪花算法生成ID,生成100万个只需要18ms,性能超级赞,使用方法与MyBatis-Plus封装的方法类似

快速使用

package main

import (
	"fmt"
	"github.com/go-minzhan/common/util"
)

func main() {
	worker, _ := util.NewSequence(1, 1)
	newId, _ := worker.NextId()
	fmt.Println(newId)
}
Similar Resources

Set of functions/methods that will ease GO code generation

Set of functions/methods that will ease GO code generation

Dec 1, 2021

Support CI generation of SBOMs via golang tooling.

Support CI generation of SBOMs via golang tooling.

SPDX Software Bill of Materials (SBOM) Generator Overview Software Package Data Exchange (SPDX) is an open standard for communicating software bill of

Jan 3, 2023

Code generation for golang's constructor

constructor Generate constructor for a given struct. Usage of constructor: -exclude string the fields to exclude. Use comma to specify multi

Dec 26, 2021

Knit is an inline code generation tool that combines the power of Go's text/template package with automatic spec file loading.

Knit Knit is an inline code generation tool that combines the power of Go's text/template package with automatic spec file loading. Example openapi: "

Sep 15, 2022

Evolutionary optimization library for Go (genetic algorithm, partical swarm optimization, differential evolution)

Evolutionary optimization library for Go (genetic algorithm, partical swarm optimization, differential evolution)

eaopt is an evolutionary optimization library Table of Contents Changelog Example Background Features Usage General advice Genetic algorithms Overview

Dec 30, 2022

Genetic Algorithm written in go

This genetic algorithm is designed to minimise the problem specific code from a genetic algorithm. The three interfaces Gene, Initialiser, an Evaluato

Feb 15, 2022

Geth client which picks the most profitable blocks to mine using a greedy algorithm

Greeden-Geth Greeden-Geth is a protocol-agnostic client which uses a greedy algorithm to pick the most profitable blocks to submit to the network out

Nov 16, 2022

Go implementation of Donald Knuth's Algorithm 7.2.2.1C for exact cover with colors.

go-dlx Go implementation of Donald Knuth's Algorithm 7.2.2.1C for exact cover with colors. This code is based on the Algorithm C described in http://w

Dec 14, 2022

Simple distributed kv-store using ABD algorithm.

Distributed-kv-store Simple distributed kv-store using ABD algorithm. API GET /key Get value by key. 302 = found key. PUT /key Put key with value. 201

Dec 14, 2021
elPrep: a high-performance tool for analyzing sequence alignment/map files in sequencing pipelines.
elPrep: a high-performance tool for analyzing sequence alignment/map files in sequencing pipelines.

Overview elPrep is a high-performance tool for analyzing .sam/.bam files (up to and including variant calling) in sequencing pipelines. The key advant

Nov 2, 2022
A command line tool to generate sequence diagrams
A command line tool to generate sequence diagrams

goseq - text based sequence diagrams A small command line utility used to generate UML sequence diagrams from a text-base definition file. Inspired by

Dec 22, 2022
I'm sick. And... fibonacci sequence.
I'm sick. And... fibonacci sequence.

Fibonacci Sequence Like I said, Fibonnaci Sequence. Be happy that I didn't make any more fuss about this "achievement" (it's not, for anyone) Source c

Oct 18, 2021
A Github action to check if IDT could synthesize a given DNA sequence.

dna-is-synthesizable A github action to check if a part is synthesizable from a given Genbank file. dna-is-synthesizable is a Github Action that recei

Oct 28, 2021
seqinfo gathers image sequence info from directories.

seqinfo seqinfo gathers info from sequences in directories, and prints or writes it to an excel file. Usage seqinfo /path/to/search/sequences For adv

Dec 23, 2021
Package reservoir samples values uniformly at random from an unbounded sequence of inputs

Package reservoir samples values uniformly at random from an unbounded sequence of inputs

Oct 5, 2022
Go worker pool

description This is a generic worker pool for the Go language. It's useful when you want to limit the number of goroutines running in parallel. instal

Jul 4, 2021
Algorand offchain worker with golang

Algorand offchain worker with golang

Sep 12, 2022
:sunglasses:Package captcha provides an easy to use, unopinionated API for captcha generation

Package captcha provides an easy to use, unopinionated API for captcha generation. Why another captcha generator? I want a simple and framework-indepe

Dec 28, 2022
Support CI generation of SBOMs via golang tooling.

Software Package Data Exchange (SPDX) is an open standard for communicating software bill of materials (SBOM) information that supports accurate identification of software components, explicit mapping of relationships between components, and the association of security and licensing information with each component.

Jan 3, 2023