// ⚡️ Fiber is an Express inspired web framework written in Go with ☕️
// 🤖 Github Repository: https://github.com/gofiber/fiber
// 📌 API Documentation: https://docs.gofiber.io

package utils

import (
	
	
	
	
	
)

// CopyString copies a string to make it immutable
func ( string) string {
	return string(UnsafeBytes())
}

// CopyBytes copies a slice to make it immutable
func ( []byte) []byte {
	 := make([]byte, len())
	copy(, )
	return 
}

const (
	uByte = 1 << (10 * iota) // 1 << 10 == 1024
	uKilobyte
	uMegabyte
	uGigabyte
	uTerabyte
	uPetabyte
	uExabyte
)

// ByteSize returns a human-readable byte string of the form 10M, 12.5K, and so forth.
// The unit that results in the smallest number greater than or equal to 1 is always chosen.
func ( uint64) string {
	 := ""
	 := float64()
	switch {
	case  >= uExabyte:
		 = "EB"
		 /= uExabyte
	case  >= uPetabyte:
		 = "PB"
		 /= uPetabyte
	case  >= uTerabyte:
		 = "TB"
		 /= uTerabyte
	case  >= uGigabyte:
		 = "GB"
		 /= uGigabyte
	case  >= uMegabyte:
		 = "MB"
		 /= uMegabyte
	case  >= uKilobyte:
		 = "KB"
		 /= uKilobyte
	case  >= uByte:
		 = "B"
	default:
		return "0B"
	}
	 := strconv.FormatFloat(, 'f', 1, 64)
	 = strings.TrimSuffix(, ".0")
	return  + 
}

// ToString Change arg to string
func ( interface{},  ...string) string {
	 := reflect.Indirect(reflect.ValueOf()).Interface()
	switch v := .(type) {
	case int:
		return strconv.Itoa()
	case int8:
		return strconv.FormatInt(int64(), 10)
	case int16:
		return strconv.FormatInt(int64(), 10)
	case int32:
		return strconv.FormatInt(int64(), 10)
	case int64:
		return strconv.FormatInt(, 10)
	case uint:
		return strconv.Itoa(int())
	case uint8:
		return strconv.FormatInt(int64(), 10)
	case uint16:
		return strconv.FormatInt(int64(), 10)
	case uint32:
		return strconv.FormatInt(int64(), 10)
	case uint64:
		return strconv.FormatInt(int64(), 10)
	case string:
		return 
	case []byte:
		return string()
	case bool:
		return strconv.FormatBool()
	case float32:
		return strconv.FormatFloat(float64(), 'f', -1, 32)
	case float64:
		return strconv.FormatFloat(, 'f', -1, 64)
	case time.Time:
		if len() > 0 {
			return .Format([0])
		}
		return .Format("2006-01-02 15:04:05")
	case reflect.Value:
		return (.Interface(), ...)
	case fmt.Stringer:
		return .String()
	default:
		return ""
	}
}