FormatInt36 equal to strings.ToUpper(fmt.Sprintf("%0"+strconv.Itoa(n)+"s", strconv.FormatInt(value, 36)))
(value int64, n int)
| 21 | |
| 22 | // FormatInt36 equal to strings.ToUpper(fmt.Sprintf("%0"+strconv.Itoa(n)+"s", strconv.FormatInt(value, 36))) |
| 23 | func FormatInt36(value int64, n int) string { |
| 24 | b := make([]byte, n) |
| 25 | for i := n - 1; 0 <= i; i-- { |
| 26 | b[i] = digits[value%36] |
| 27 | value /= 36 |
| 28 | } |
| 29 | return string(b) |
| 30 | } |
| 31 | |
| 32 | const digits = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ" |
no outgoing calls