package crypto

import (
    "crypto/sha256"
    "encoding/binary"
)

func VoteMessage(issueID, optionID int64, nonce []byte) [32]byte {
	buf := make([]byte, 16+len(nonce))
	binary.BigEndian.PutUint64(buf[0:8], uint64(issueID))
	binary.BigEndian.PutUint64(buf[8:16], uint64(optionID))
	copy(buf[16:], nonce)
	return sha256.Sum256(buf)
}
