MCPcopy Index your code
hub / github.com/Print3M/ByteCaster / EncodeData

Function EncodeData

encoding/encoding.go:16–35  ·  view source on GitHub ↗
(data []byte, encoding string)

Source from the content-addressed store, hash-verified

14}
15
16func EncodeData(data []byte, encoding string) []byte {
17 enc := encoder{
18 input: data,
19 }
20
21 switch encoding {
22 case cli.OptEncodingBase32:
23 enc.base32()
24 case cli.OptEncodingBase64:
25 enc.base64()
26 case cli.OptEncodingIPv4:
27 enc.ipv4()
28 case cli.OptEncodingMAC:
29 enc.mac()
30 default:
31 log.Fatal("Unknown encoding")
32 }
33
34 return enc.output
35}
36
37func (e *encoder) base32() {
38 /*

Callers 1

mainFunction · 0.92

Calls 4

base32Method · 0.95
base64Method · 0.95
ipv4Method · 0.95
macMethod · 0.95

Tested by

no test coverage detected