func (gbt *GlobalBufferTable) New() [16]byte {
	var key [16]byte
	for {
		io.ReadFull(rand.Reader, key[:])
		if _, exist := (*gbt)[key]; !exist {
			bufferNode := makeBufferNode()
			(*gbt)[key] = &bufferNode
			return key
		}
	}
}
Create a new key-value and return the key
package magic
import (
	"crypto/rand"
	"encoding/binary"
	"io"
	"sync"
)
const maxConnection = 16
const bufSize = 64*1024 - 8
const tableSize = 65536
type GlobalBufferTable map[[16]byte](*bufferNode)
type bufferNode struct {
	Chan        chan dataBlock
	WG          sync.WaitGroup
	ExitSignals []chan bool
	Lock        sync.Mutex
}
func makeBufferNode() bufferNode {
	var wg sync.WaitGroup
	var lock sync.Mutex
	return bufferNode{
		make(chan dataBlock, maxConnection*2),
		wg,
		make([]chan bool, 0),
		lock,
	}
}
type dataBlock struct {
	Data    []byte
	Size    uint32
	BlockId uint32
}
func (dataBlock dataBlock) Pack() []byte {
	packedData := make([]byte, 8+dataBlock.Size)
	binary.LittleEndian.PutUint32(packedData[:], dataBlock.BlockId)
	binary.LittleEndian.PutUint32(packedData[4:], dataBlock.Size)
	copy(packedData[8:], dataBlock.Data)
	return packedData
}