mirror of
https://salsa.debian.org/mdosch/feed-to-muc.git
synced 2024-11-14 18:26:50 +01:00
1.3 KiB
1.3 KiB
sid : generate sortable identifiers
Overview
This package is simple and only provides one function. The aim here is not pure speed, it is for an easy use-case without having to worry about goroutines and locking.
Install
go get github.com/chilts/sid
Example
id1 := sid.Id()
id2 := sid.IdHex()
id3 := sid.IdBase32()
id4 := sid.IdBase64()
fmt.Printf("id1 = %s\n", id1)
fmt.Printf("id2 = %s\n", id2)
fmt.Printf("id3 = %s\n", id3)
fmt.Printf("id4 = %s\n", id4)
// -> "id1 = 1559872035903071353-1186579057231285506"
// -> "id2 = 15a5cf57e7d2a837-6eaafe687e7b3ec3"
// -> "id3 = 1b9efqnl51jj7-4u66ikpfq9ugm"
// -> "id4 = 1IeSBAWW9kK-0cDG64GQgGJ"
Author
By Andrew Chilton, @twitter.
For AppsAttic, @AppsAttic.
License
(Ends)