MCPcopy
hub / github.com/rs/xid / String

Method String

id.go:171–175  ·  view source on GitHub ↗

String returns a base32 hex lowercased with no padding representation of the id (char set is 0-9, a-v).

()

Source from the content-addressed store, hash-verified

169
170// String returns a base32 hex lowercased with no padding representation of the id (char set is 0-9, a-v).
171func (id ID) String() string {
172 text := make([]byte, encodedLen)
173 encode(text, id[:])
174 return string(text)
175}
176
177// Encode encodes the id using base32 encoding, writing 20 bytes to dst and return it.
178func (id ID) Encode(dst []byte) []byte {

Callers 5

TestIDStringFunction · 0.95
TestPaddingFunction · 0.80
BenchmarkNewStringFunction · 0.80
TestFromStringQuickFunction · 0.80

Calls 1

encodeFunction · 0.85

Tested by 5

TestIDStringFunction · 0.76
TestPaddingFunction · 0.64
BenchmarkNewStringFunction · 0.64
TestFromStringQuickFunction · 0.64