func (s *zgokSignature) appBytes() [APP_BYTE_SIZE]byte {
	var result [APP_BYTE_SIZE]byte
	appBytes := []byte(s.app)
	for i := range result {
		if i < len(appBytes) {
			result[i] = appBytes[i]
		}
	}
	return result
}
Byte array of the app string.
package zgok
import (
	"bytes"
	"encoding/binary"
	"fmt"
)
const (
	APP_BYTE_SIZE       = 8   
	SIGNATURE_BYTE_SIZE = 64  
)
type Signature interface {
	ExeSize() int64
	SetExeSize(exeSize int64)
	ZipSize() int64
	SetZipSize(zipSize int64)
	TotalSize() int64
	String() string
	Dump() ([]byte, error)
}
type zgokSignature struct {
	app       string            
	major     uint16            
	minor     uint16            
	rev       uint16            
	exeSize   int64             
	zipSize   int64             
	byteOrder binary.ByteOrder  
}
func NewSignature() Signature {
	return &zgokSignature{
		app:       APP,
		major:     MAJOR,
		minor:     MINOR,
		rev:       REV,
		byteOrder: binary.BigEndian,
	}
}
func RestoreSignature(data []byte) (Signature, error) {
	if len(data) != SIGNATURE_BYTE_SIZE {
		return nil, fmt.Errorf("invalid signature size")
	}
	buf := bytes.NewBuffer(data)
	s := &zgokSignature{
		byteOrder: binary.BigEndian,
	}
	appBytes := make([]byte, APP_BYTE_SIZE)
	_, err := buf.Read(appBytes)
	if err != nil {
		return nil, err
	}
	app, err := restoreAppString(appBytes)
	if err != nil {
		return nil, err
	}
	if app != APP {
		return nil, fmt.Errorf("invalid signature")
	}
	s.app = app
	var major uint16
	err = binary.Read(buf, s.byteOrder, &major)
	if err != nil {
		return nil, err
	}
	s.major = major
	var minor uint16
	err = binary.Read(buf, s.byteOrder, &minor)
	if err != nil {
		return nil, err
	}
	s.minor = minor
	var rev uint16
	err = binary.Read(buf, s.byteOrder, &rev)
	if err != nil {
		return nil, err
	}
	s.rev = rev
	var exeSize int64
	err = binary.Read(buf, s.byteOrder, &exeSize)
	if err != nil {
		return nil, err
	}
	if exeSize <= 0 {
		return nil, fmt.Errorf("invalid signature")
	}
	s.exeSize = exeSize
	var zipSize int64
	err = binary.Read(buf, s.byteOrder, &zipSize)
	if err != nil {
		return nil, err
	}
	if zipSize <= 0 {
		return nil, fmt.Errorf("invalid signature")
	}
	s.zipSize = zipSize
	return s, nil
}
func restoreAppString(appBytes []byte) (string, error) {
	if len(appBytes) != APP_BYTE_SIZE {
		return "", fmt.Errorf("invalid app byte size")
	}
	appLen := bytes.IndexByte(appBytes, 0)
	if appLen < 0 || APP_BYTE_SIZE < appLen {
		appLen = APP_BYTE_SIZE
	}
	app := string(appBytes[:appLen])
	return app, nil
}
func (sig *zgokSignature) ExeSize() int64 {
	return sig.exeSize
}
func (sig *zgokSignature) SetExeSize(exeSize int64) {
	sig.exeSize = exeSize
}
func (sig *zgokSignature) ZipSize() int64 {
	return sig.zipSize
}
func (sig *zgokSignature) SetZipSize(zipSize int64) {
	sig.zipSize = zipSize
}
func (s *zgokSignature) TotalSize() int64 {
	return s.exeSize + s.zipSize + SIGNATURE_BYTE_SIZE
}
func (s *zgokSignature) String() string {
	return fmt.Sprintf("%s(exe:%d,zip:%d,total:%d)",
		Version(), s.exeSize, s.zipSize, s.TotalSize())
}
func (s *zgokSignature) Dump() ([]byte, error) {
	buf := new(bytes.Buffer)
	byteCount := 0
	appBytes := s.appBytes()
	err := binary.Write(buf, s.byteOrder, appBytes)
	if err != nil {
		return []byte{}, err
	}
	byteCount += binary.Size(appBytes)
	err = binary.Write(buf, s.byteOrder, s.major)
	if err != nil {
		return []byte{}, err
	}
	byteCount += binary.Size(s.major)
	err = binary.Write(buf, s.byteOrder, s.minor)
	if err != nil {
		return []byte{}, err
	}
	byteCount += binary.Size(s.minor)
	err = binary.Write(buf, s.byteOrder, s.rev)
	if err != nil {
		return []byte{}, err
	}
	byteCount += binary.Size(s.rev)
	err = binary.Write(buf, s.byteOrder, s.exeSize)
	if err != nil {
		return []byte{}, err
	}
	byteCount += binary.Size(s.exeSize)
	err = binary.Write(buf, s.byteOrder, s.zipSize)
	if err != nil {
		return []byte{}, err
	}
	byteCount += binary.Size(s.zipSize)
	for i := byteCount; i < SIGNATURE_BYTE_SIZE; i++ {
		err := binary.Write(buf, s.byteOrder, byte(0))
		if err != nil {
			return []byte{}, err
		}
	}
	return buf.Bytes(), nil
}