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 (
|
import (
|
||||||
"encoding/base64"
|
"encoding/base64"
|
||||||
"encoding/hex"
|
"encoding/hex"
|
||||||
|
"strings"
|
||||||
)
|
)
|
||||||
|
|
||||||
type BytesResult []byte
|
type BytesResult []byte
|
||||||
@ -11,6 +12,10 @@ func (r BytesResult) Hex() string {
|
|||||||
return hex.EncodeToString(r)
|
return hex.EncodeToString(r)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (r BytesResult) UppercaseHex() string {
|
||||||
|
return strings.ToUpper(hex.EncodeToString(r))
|
||||||
|
}
|
||||||
|
|
||||||
func (r BytesResult) Base64() string {
|
func (r BytesResult) Base64() string {
|
||||||
return base64.StdEncoding.EncodeToString(r)
|
return base64.StdEncoding.EncodeToString(r)
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user