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

十六进制大写输出

This commit is contained in:
2022-05-27 10:41:22 +08:00
parent a31e054a70
commit 3cc5b24d65

View File

@ -3,6 +3,7 @@ package bytesconv
import (
"encoding/base64"
"encoding/hex"
"strings"
)
type BytesResult []byte
@ -11,6 +12,10 @@ func (r BytesResult) Hex() string {
return hex.EncodeToString(r)
}
func (r BytesResult) UppercaseHex() string {
return strings.ToUpper(hex.EncodeToString(r))
}
func (r BytesResult) Base64() string {
return base64.StdEncoding.EncodeToString(r)
}