mirror of
https://github.com/charlienet/go-mixed.git
synced 2025-07-18 00:22:41 +08:00
十六进制大写输出
This commit is contained in:
@ -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)
|
||||
}
|
||||
|
Reference in New Issue
Block a user