commit 9438890e4f030ab1c4b610196a37d30b8b8d4dd5
parent 9e7cf3e0ec6ec413577ef11ff5f595a6fe42b8d6
Author: Matsuda Kenji <info@mtkn.jp>
Date: Wed, 6 Sep 2023 08:47:23 +0900
implement newR...() functions
Diffstat:
1 file changed, 8 insertions(+), 0 deletions(-)
diff --git a/qid.go b/qid.go
@@ -24,6 +24,14 @@ type Qid struct {
Path uint64
}
+func unmarshalQid(b []byte) Qid {
+ return Qid{
+ Type: QidType(b[0]),
+ Vers: gbit32(b[1:5]),
+ Path: gbit64(b[5:13]),
+ }
+}
+
func (q Qid) marshal() []byte {
buf := make([]byte, 13)
buf[0] = uint8(q.Type)