aboutsummaryrefslogtreecommitdiff
path: root/stream.go
diff options
context:
space:
mode:
Diffstat (limited to 'stream.go')
-rw-r--r--stream.go15
1 files changed, 15 insertions, 0 deletions
diff --git a/stream.go b/stream.go
index 3037281..c4019b8 100644
--- a/stream.go
+++ b/stream.go
@@ -1,5 +1,6 @@
package salticidae
+// #include <stdlib.h>
// #include "salticidae/stream.h"
import "C"
@@ -88,3 +89,17 @@ func (self DataStream) GetHash() UInt256 {
return C.datastream_get_hash(self)
}
+func (self DataStream) GetHex() string {
+ tmp := C.datastream_get_hex(self)
+ res := C.GoString(tmp)
+ C.free(rawptr_t(tmp))
+ return res
+}
+
+func (self UInt256) GetHex() string {
+ s := NewDataStream()
+ self.Serialize(s)
+ res := s.GetHex()
+ s.Free()
+ return res
+}