Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Command-line tool #1

Open
sergeevabc opened this issue Jan 14, 2023 · 1 comment
Open

Command-line tool #1

sergeevabc opened this issue Jan 14, 2023 · 1 comment

Comments

@sergeevabc
Copy link

sergeevabc commented Jan 14, 2023

Dear @kokizzu,
I'm not sure how to appreciate the beauty of your solution without being able to run it on Windows as a binary that produces the result. E.g. check ULID and CUIDv2

$ ulid.exe
01GPR0A4J919E253QDAGVR8MK7

$ cuidgen.exe
gib227a07c6a1njttd9jn982
@kokizzu
Copy link
Owner

kokizzu commented Jan 14, 2023

if without configuration it would be as easy as this:

package main
import "fmt"
import "github.com/kokizzu/lexid"
func main() {
    fmt.Println(lexid.ID())
    // or
    fmt.Println(lexid.NanoID())
}

then just run it:

go mod init x # init project
go mod tidy # download dependencies

go run a.go
0YkljQ~-----0~0
0RuHN8PMPFN~-----1~0

go run a.go
0YkljT~-----0~0
0RuHNBBfWV-~-----1~0

but lexid heavily configurable/customizable (you can offset the time, change/remove separator), unlike ulid or uuid that only have few fixed format

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants