Skip to content

Parser is available

Compare
Choose a tag to compare
@nurked nurked released this 11 Aug 19:24

Now you can parse values of the GUID back. Parser is a method on a generator. You would have to set generator values, before using the parser.

Needless to say, if you want to get some meaningful values back from GUID you would have to set the same settings on a generator.

	var test UUIDv7Generator
	test.SubsecondPrecisionLength = 16
	test.NodePrecisionLength = 4
	test.Node = 15
	test.CounterPrecisionLength = 8
	guid := test.Next()
	test.Parse(&guid)
	ps, c, n := test.Parse(&guid)
	fmt.Print("Precision nanosecond:", ps, "Counter:", c, "Node value:", n)