fixes for develop+permissions merge

This commit is contained in:
Jae Kwon
2015-07-07 14:17:20 -07:00
parent 625c72a110
commit 21295f4ae2
6 changed files with 19 additions and 7 deletions
+11
View File
@@ -28,6 +28,12 @@ func (w Word256) Compare(other Word256) int {
return bytes.Compare(w[:], other[:])
}
func Uint64ToWord256(i uint64) Word256 {
buf := [8]byte{}
PutUint64BE(buf[:], i)
return LeftPadWord256(buf[:])
}
func Int64ToWord256(i int64) Word256 {
buf := [8]byte{}
PutInt64BE(buf[:], i)
@@ -44,6 +50,11 @@ func LeftPadWord256(bz []byte) (word Word256) {
return
}
func Uint64FromWord256(word Word256) uint64 {
buf := word.Postfix(8)
return GetUint64BE(buf)
}
func Int64FromWord256(word Word256) int64 {
buf := word.Postfix(8)
return GetInt64BE(buf)