MCPcopy
hub / github.com/cloudreve/cloudreve / Encode

Method Encode

service/admin/tools.go:61–76  ·  view source on GitHub ↗
(c *gin.Context)

Source from the content-addressed store, hash-verified

59)
60
61func (service *BsEncodeService) Encode(c *gin.Context) (*BsEncodeRes, error) {
62 bs := &boolset.BooleanSet{}
63 for _, v := range service.Bool {
64 boolset.Set(v, true, bs)
65 }
66
67 res, err := bs.MarshalBinary()
68 if err != nil {
69 return nil, err
70 }
71
72 return &BsEncodeRes{
73 Hex: hex.EncodeToString(res),
74 B64: res,
75 }, nil
76}
77
78type (
79 BsDecodeService struct {

Callers

nothing calls this directly

Calls 2

MarshalBinaryMethod · 0.95
SetFunction · 0.92

Tested by

no test coverage detected