func (n *Node) ID() int64 {
	return n.GenerateWithInt64()
}
ID creates and returns a unique snowflake ID
package snowflake
import (
	"errors"
	"strconv"
	"sync/atomic"
	"time"
	"unsafe"
)
var (
	Epoch = int64(1288834974657)
	NodeBits uint8 = 8
	StepBits uint8 = 14
	nodeMax   = int64(-1 ^ (-1 << NodeBits))
	nodeMask  = int64(nodeMax << StepBits)
	stepMask  = int64(-1 ^ (-1 << StepBits))
	timeShift = uint8(NodeBits + StepBits)
	nodeShift = uint8(StepBits)
)
type Node struct {
	nodeVal int64
	node    int64
	ni      unsafe.Pointer
	epoch   time.Time
}
type nodeItem struct {
	time int64
	step int64
}
type ID int64
func NewNode(node uint8) (*Node, error) {
	if node < 0 || int64(node) > nodeMax {
		return nil, errors.New("Node number must be between 0 and " + strconv.FormatInt(nodeMax, 10))
	}
	n := nodeItem{}
	var curTime = time.Now()
	ne := &Node{
		node: int64(node),
		ni:   unsafe.Pointer(&n),
		epoch: curTime.Add(time.Unix(Epoch/1000, (Epoch%1000)*1000000).Sub(curTime)),
	}
	ne.nodeVal = ne.node << nodeShift
	return ne, nil
}
func (n *Node) Generate() ID {
	return ID(n.GenerateWithInt64())
}