Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Index your code
hub
/
github.com/bwmarrin/snowflake
/ functions
Functions
50 in github.com/bwmarrin/snowflake
⨍
Functions
50
◇
Types & classes
3
↓ 21 callers
Function
NewNode
NewNode returns a new snowflake node that can be used to generate snowflake IDs
snowflake.go:100
↓ 20 callers
Method
Generate
Generate creates and returns a unique snowflake ID To help guarantee uniqueness - Make sure your system is keeping accurate system time - Make sure yo
snowflake.go:135
↓ 6 callers
Method
Int64
Int64 returns an int64 of the snowflake ID
snowflake.go:165
↓ 4 callers
Method
Base32
Base32 uses the z-base-32 character set but encodes and decodes similar to base58, allowing it to create an even smaller result string. NOTE: There ar
snowflake.go:201
↓ 4 callers
Method
Base58
Base58 returns a base58 string of the snowflake ID
snowflake.go:250
↓ 4 callers
Function
ParseBytes
ParseBytes converts a byte slice into a snowflake ID
snowflake.go:306
↓ 3 callers
Method
Bytes
Bytes returns a byte slice of the snowflake ID
snowflake.go:301
↓ 3 callers
Method
IntBytes
IntBytes returns an array of bytes of the snowflake ID, encoded as a big endian integer.
snowflake.go:313
↓ 3 callers
Method
MarshalJSON
MarshalJSON returns a json byte array string of the snowflake ID.
snowflake.go:344
↓ 3 callers
Function
ParseBase2
ParseBase2 converts a Base2 string into a snowflake ID
snowflake.go:192
↓ 3 callers
Function
ParseBase36
ParseBase36 converts a Base36 string into a snowflake ID
snowflake.go:244
↓ 3 callers
Function
ParseBase64
ParseBase64 converts a base64 string into a snowflake ID
snowflake.go:291
↓ 3 callers
Function
ParseString
ParseString converts a string into a snowflake ID
snowflake.go:180
↓ 3 callers
Method
String
String returns a string of the snowflake ID
snowflake.go:175
↓ 2 callers
Method
Base2
Base2 returns a string base2 of the snowflake ID
snowflake.go:187
↓ 2 callers
Method
Base36
Base36 returns a base36 string of the snowflake ID
snowflake.go:239
↓ 2 callers
Method
Base64
Base64 returns a base64 string of the snowflake ID
snowflake.go:286
↓ 2 callers
Function
ParseBase32
ParseBase32 parses a base32 []byte into a snowflake ID NOTE: There are many different base32 implementations so becareful when doing any interoperatio
snowflake.go:224
↓ 2 callers
Function
ParseBase58
ParseBase58 parses a base58 []byte into a snowflake ID
snowflake.go:271
↓ 2 callers
Function
ParseInt64
ParseInt64 converts an int64 into a snowflake ID
snowflake.go:170
↓ 2 callers
Function
ParseIntBytes
ParseIntBytes converts an array of bytes encoded as big endian integer as a snowflake ID
snowflake.go:321
↓ 2 callers
Method
UnmarshalJSON
UnmarshalJSON converts a json byte array of a snowflake ID into an ID type.
snowflake.go:353
Function
BenchmarkBase32
(b *testing.B)
snowflake_test.go:374
Function
BenchmarkBase58
(b *testing.B)
snowflake_test.go:399
Function
BenchmarkGenerate
(b *testing.B)
snowflake_test.go:411
Function
BenchmarkGenerateMaxSequence
(b *testing.B)
snowflake_test.go:423
Function
BenchmarkMarshal
(b *testing.B)
snowflake_test.go:452
Function
BenchmarkParseBase32
**************************************************************************** Benchmark Methods
snowflake_test.go:361
Function
BenchmarkParseBase58
(b *testing.B)
snowflake_test.go:386
Function
BenchmarkUnmarshal
(b *testing.B)
snowflake_test.go:437
Method
Error
()
snowflake.go:47
Method
Node
Node returns an int64 of the snowflake ID node number DEPRECATED: the below function will be removed in a future release.
snowflake.go:333
Method
Step
Step returns an int64 of the snowflake step (or sequence) number DEPRECATED: the below function will be removed in a future release.
snowflake.go:339
Function
TestBase2
(t *testing.T)
snowflake_test.go:124
Function
TestBase32
(t *testing.T)
snowflake_test.go:154
Function
TestBase36
(t *testing.T)
snowflake_test.go:175
Function
TestBase58
(t *testing.T)
snowflake_test.go:205
Function
TestBase64
(t *testing.T)
snowflake_test.go:226
Function
TestBytes
(t *testing.T)
snowflake_test.go:256
Function
TestGenerateDuplicateID
****************************************************************************** General Test funcs lazy check if Generate will create duplicate IDs wou
snowflake_test.go:14
Function
TestInt64
(t *testing.T)
snowflake_test.go:71
Function
TestIntBytes
(t *testing.T)
snowflake_test.go:286
Function
TestMarshalJSON
****************************************************************************** Marshall Test Methods
snowflake_test.go:312
Function
TestMarshalsIntBytes
(t *testing.T)
snowflake_test.go:326
Function
TestPrintAll
****************************************************************************** Converters/Parsers Test funcs We should have funcs here to test convers
snowflake_test.go:51
Function
TestRace
I feel like there's probably a better way
snowflake_test.go:29
Function
TestString
(t *testing.T)
snowflake_test.go:93
Function
TestUnmarshalJSON
(t *testing.T)
snowflake_test.go:334
Method
Time
Time returns an int64 unix timestamp in milliseconds of the snowflake ID time DEPRECATED: the below function will be removed in a future release.
snowflake.go:327
Function
init
Create maps for decoding Base58/Base32. This speeds up the process tremendously.
snowflake.go:59