MCPcopy Create free account
hub / github.com/astaxie/gopkg / ExampleEncode2

Function ExampleEncode2

encoding/base32/examples/Encode_test.go:32–62  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

30}
31
32func ExampleEncode2() {
33
34 // 编码缓冲区需要的长度会被填充到8的倍数
35 for ii := 0; ii < 20; ii++ {
36 l := base32.StdEncoding.EncodedLen(ii)
37 fmt.Println(l, l%8 == 0) // true
38 }
39
40 // Output:
41 // 0 true
42 // 8 true
43 // 8 true
44 // 8 true
45 // 8 true
46 // 8 true
47 // 16 true
48 // 16 true
49 // 16 true
50 // 16 true
51 // 16 true
52 // 24 true
53 // 24 true
54 // 24 true
55 // 24 true
56 // 24 true
57 // 32 true
58 // 32 true
59 // 32 true
60 // 32 true
61
62}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected