mirror of
https://github.com/kovidgoyal/kitty.git
synced 2026-08-03 22:25:57 +00:00
Make CreateSignature byte oriented
This commit is contained in:
parent
71a1050b9f
commit
c28f6a7bf4
2 changed files with 30 additions and 14 deletions
|
|
@ -86,12 +86,12 @@ type BlockHash struct {
|
|||
WeakHash uint32
|
||||
}
|
||||
|
||||
func (self BlockHash) Serialize() string {
|
||||
func (self BlockHash) Serialize() []byte {
|
||||
ans := make([]byte, 12+len(self.StrongHash))
|
||||
bin.PutUint64(ans, self.Index)
|
||||
bin.PutUint32(ans[8:], self.WeakHash)
|
||||
copy(ans[12:], self.StrongHash)
|
||||
return utils.UnsafeBytesToString(ans)
|
||||
return ans
|
||||
}
|
||||
|
||||
func (self BlockHash) Unserialize(data []byte, hash_size int) (err error) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue