1
0
mirror of https://github.com/charlienet/go-mixed.git synced 2025-07-18 08:32:40 +08:00

bytesconv

This commit is contained in:
2022-03-29 10:24:43 +08:00
parent 42f85a2518
commit bd4a7aed01
6 changed files with 86 additions and 91 deletions

24
bytesconv/byteResult.go Normal file
View File

@ -0,0 +1,24 @@
package bytesconv
import (
"encoding/base64"
"encoding/hex"
)
type BytesResult []byte
func (r BytesResult) Hex() string {
return hex.EncodeToString(r)
}
func (r BytesResult) Base64() string {
return base64.StdEncoding.EncodeToString(r)
}
func (r BytesResult) Bytes() []byte {
return r
}
func (r BytesResult) String() string {
return r.Hex()
}