mirror of
https://github.com/ScuroNeko/mtg.git
synced 2026-08-31 17:34:01 +03:00
Remove unnecessary hexify function
This commit is contained in:
@@ -1,10 +1,5 @@
|
|||||||
package utils
|
package utils
|
||||||
|
|
||||||
import (
|
|
||||||
"fmt"
|
|
||||||
"strings"
|
|
||||||
)
|
|
||||||
|
|
||||||
type Uint24 [3]byte
|
type Uint24 [3]byte
|
||||||
|
|
||||||
func ToUint24(number uint32) Uint24 {
|
func ToUint24(number uint32) Uint24 {
|
||||||
@@ -14,17 +9,3 @@ func ToUint24(number uint32) Uint24 {
|
|||||||
func FromUint24(number Uint24) uint32 {
|
func FromUint24(number Uint24) uint32 {
|
||||||
return uint32(number[0]) + (uint32(number[1]) << 8) + (uint32(number[2]) << 16)
|
return uint32(number[0]) + (uint32(number[1]) << 8) + (uint32(number[2]) << 16)
|
||||||
}
|
}
|
||||||
|
|
||||||
func Hexify(data []byte) string {
|
|
||||||
s := []string{}
|
|
||||||
|
|
||||||
for _, v := range data {
|
|
||||||
if v < 0x10 {
|
|
||||||
s = append(s, fmt.Sprintf("0x0%x", v))
|
|
||||||
} else {
|
|
||||||
s = append(s, fmt.Sprintf("0x%x", v))
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return strings.Join(s, " ")
|
|
||||||
}
|
|
||||||
|
|||||||
Reference in New Issue
Block a user