MCPcopy
hub / github.com/AlexxIT/go2rtc / FormatInt36

Function FormatInt36

pkg/hap/setup/setup.go:23–30  ·  view source on GitHub ↗

FormatInt36 equal to strings.ToUpper(fmt.Sprintf("%0"+strconv.Itoa(n)+"s", strconv.FormatInt(value, 36)))

(value int64, n int)

Source from the content-addressed store, hash-verified

21
22// FormatInt36 equal to strings.ToUpper(fmt.Sprintf("%0"+strconv.Itoa(n)+"s", strconv.FormatInt(value, 36)))
23func 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
32const digits = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"

Callers 2

GenerateSetupURIFunction · 0.85
TestFormatAlphaNumFunction · 0.85

Calls

no outgoing calls

Tested by 1

TestFormatAlphaNumFunction · 0.68