diff options
author | Determinant <ted.sybil@gmail.com> | 2019-06-11 00:04:12 -0400 |
---|---|---|
committer | Determinant <ted.sybil@gmail.com> | 2019-06-11 00:04:12 -0400 |
commit | df87359ec575622687b5f6b8319fb30ba4340caf (patch) | |
tree | 450e415c7836c5ed99a5c7fd17a72c7fefc6e725 /stream.go | |
parent | 7636ae38cff0f09783b64f174f67f9e018762a04 (diff) |
...
Diffstat (limited to 'stream.go')
-rw-r--r-- | stream.go | 15 |
1 files changed, 15 insertions, 0 deletions
@@ -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 +} |