Converts a base 62 byte into the number value that it represents.
(digit byte)
| 19 | |
| 20 | // Converts a base 62 byte into the number value that it represents. |
| 21 | func 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. |
no outgoing calls
searching dependent graphs…