mirror of
https://github.com/NotAShelf/hexxy.git
synced 2024-11-22 21:31:12 +00:00
[hexxy] move dev to main and remove unused functions
This commit is contained in:
parent
25db94290c
commit
c5c01b4f77
1 changed files with 0 additions and 20 deletions
20
color.go
20
color.go
|
@ -2,7 +2,6 @@ package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"strconv"
|
"strconv"
|
||||||
"unsafe"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
const GREY = "\x1b[38;2;111;111;111m"
|
const GREY = "\x1b[38;2;111;111;111m"
|
||||||
|
@ -46,22 +45,3 @@ func (c *Color) Colorize(s string, clr byte) string {
|
||||||
func (c *Color) Colorize2(clr byte) ([]byte, []byte) {
|
func (c *Color) Colorize2(clr byte) ([]byte, []byte) {
|
||||||
return c.cvalues[clr], CLRR
|
return c.cvalues[clr], CLRR
|
||||||
}
|
}
|
||||||
|
|
||||||
func IntToByteArray(num int) []byte {
|
|
||||||
size := int(unsafe.Sizeof(num))
|
|
||||||
arr := make([]byte, size)
|
|
||||||
for i := 0; i < size; i++ {
|
|
||||||
byt := *(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(&num)) + uintptr(i)))
|
|
||||||
arr[i] = byt
|
|
||||||
}
|
|
||||||
return arr
|
|
||||||
}
|
|
||||||
|
|
||||||
func ByteArrayToInt(arr []byte) int64 {
|
|
||||||
val := int64(0)
|
|
||||||
size := len(arr)
|
|
||||||
for i := 0; i < size; i++ {
|
|
||||||
*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(&val)) + uintptr(i))) = arr[i]
|
|
||||||
}
|
|
||||||
return val
|
|
||||||
}
|
|
||||||
|
|
Loading…
Reference in a new issue