func GetBytePercent(b []byte, sig uint) int {
	div := float64(len(b) * 256 / (9 - int(sig)))
	i := float64(GetSize(b, sig))
	x := math.Ceil((i / div) * 100)
	return int(x)
}
GetBytePercent will fetch an int from a byte as a percentage
package frames
import (
	"encoding/binary"
	"fmt"
	"math"
	"strconv"
	"strings"
	"unicode/utf16"
	"unicode/utf8"
)
type IFrame interface {
	DisplayContent() string
	GetExplain() string
	GetLength() int
	GetName() string
	Init(n, d string, s int)
	ProcessData(int, []byte) IFrame
}
type FrameFile interface {
	Close() error
	Read([]byte) (int, error)
	Seek(int64, int) (int64, error)
	Write([]byte) (int, error)
}
const (
	Version2 = 2
	Version3 = 3
	Version4 = 4
	LengthUnicode = 2
	LengthStandard = 1
)
type Frame struct {
	Name        string `json:"name"`
	Version     int    `json:"-" yaml:"-"`
	Description string `json:"description"`
	Data        []byte `json:"-" yaml:"-"`
	Cleaned     string `json:"cleaned"`
	Size        int    `json:"size"`
	Flags        int  `json:"flags"`
	TagPreserve  bool `json:"tag_preserve"`
	FilePreserve bool `json:"file_preserve"`
	ReadOnly     bool `json:"read_only"`
	Compression  bool `json:"compression"`
	Encryption   bool `json:"encryption"`
	Grouping     bool `json:"grouping"`
	Utf16 bool `json:"utf16"`
}
func GetStr(b []byte) string {
	str := string(b)
	if !utf8.ValidString(str) {
		r := make([]rune, 0, len(str))
		for i, v := range str {
			if v == utf8.RuneError {
				_, size := utf8.DecodeRuneInString(str[i:])
				if size == 1 {
					continue
				}
			}
			r = append(r, v)
		}
		str = string(r)
	}
	return strings.Trim(str, " \t\n\r\x00")
}
func GetUnicodeStr(d []byte) string {
	byteOrder := []byte{d[0], d[1]}
	var b binary.ByteOrder
	d = d[2:]
	resp := ""
	if len(d) > 1 {
		if byteOrder[0] == '\xFF' && byteOrder[1] == '\xFE' {
			b = binary.LittleEndian
		} else if byteOrder[0] == '\xFE' && byteOrder[1] == '\xFF' {
			b = binary.BigEndian
		}
		str := make([]uint16, 0, len(d)/2)
		for i := 0; i < len(d); i += 2 {
			str = append(str, b.Uint16(d[i:i+2]))
		}
		resp = string(utf16.Decode(str))
	}
	return resp
}
func GetInt(b []byte) int {
	s, _ := strconv.Atoi(GetStr(b))  
	return s
}
func GetBitInt(b byte, ltr bool, l int) int {
	r := 0
	if !ltr {
		for a := 0; a < l; a++ {
			r += int(b << uint(a*8))
		}
	}
	return r
}
func GetDirectInt(b byte) int {
	i, _ := strconv.Atoi(fmt.Sprintf("%d", b))  
	return i
}
func GetBoolBit(b byte, i uint) bool {
	n := byte(1 << i)    
	return (b & n) == n  
}
func GetSize(b []byte, sig uint) int {
	s := 0
	for _, b := range b {
		s = s << sig
		s |= int(b)
	}
	return s
}