MCPcopy
hub / github.com/segmentio/ksuid / base62Value

Function base62Value

base62.go:21–30  ·  view source on GitHub ↗

Converts a base 62 byte into the number value that it represents.

(digit byte)

Source from the content-addressed store, hash-verified

19
20// Converts a base 62 byte into the number value that it represents.
21func base62Value(digit byte) byte {
22 switch {
23 case digit >= '0' && digit <= '9':
24 return digit - '0'
25 case digit >= 'A' && digit <= 'Z':
26 return offsetUppercase + (digit - 'A')
27 default:
28 return offsetLowercase + (digit - 'a')
29 }
30}
31
32// This function encodes the base 62 representation of the src KSUID in binary
33// form into dst.

Callers 2

fastDecodeBase62Function · 0.85
TestBase62ValueFunction · 0.85

Calls

no outgoing calls

Tested by 1

TestBase62ValueFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…