From c5c01b4f777e849780911576c04bcb4a94f0ad13 Mon Sep 17 00:00:00 2001 From: mizi Date: Thu, 1 Feb 2024 16:22:54 -0900 Subject: [PATCH] [hexxy] move dev to main and remove unused functions --- color.go | 20 -------------------- 1 file changed, 20 deletions(-) diff --git a/color.go b/color.go index ef3d2b4..7055f63 100644 --- a/color.go +++ b/color.go @@ -2,7 +2,6 @@ package main import ( "strconv" - "unsafe" ) 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) { 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 -}