moved a lot
This commit is contained in:
1 parent
5772a7d855
commit
136a1c34b3
98 files changed
+6950
-2183
No files matched your search
@@ -0,0 +1,14 @@
|
||||
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)
|
||||
}
|
||||
Reference in new issue
Block a user