func (en *ExtraNonce2) Bytes() (b []byte) {
	b = make([]byte, en.Size, en.Size)
	for i := uint(0); i < en.Size; i++ {
		b[(en.Size-1)-i] = byte(en.Value >> (i * 8))
	}
	return
}
Bytes is a bigendian representation of the extranonce2
package stratum
import (
	"encoding/hex"
	"errors"
)
func HexStringToBytes(v interface{}) (result []byte, err error) {
	var ok bool
	var stringValue string
	if stringValue, ok = v.(string); !ok {
		return nil, errors.New("Not a valid string")
	}
	if result, err = hex.DecodeString(stringValue); err != nil {
		return nil, errors.New("Not a valid hexadecimal value")
	}
	return
}
type ExtraNonce2 struct {
	Value uint64
	Size  uint
}