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

Function ExampleEncode2

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

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected