antirez / antirez/listpack

why string "hello" is "\x45hello" not "\x85hello"?

未关闭
#2 3 条评论 2 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
C
星标
98
派生
18
PR 合并指标
30 天内没有已合并 PR

描述

The length of "hello" is 5, it's less then 63, so it matches this format
```
10|xxxxxx
```

The first 2bit is `10`, and the rest 6bit representing the length of the ``, in this case, is 5(the length of "hello"),5 convert to binary code is `101`, we use `000` the make it reach 6bit, so it should be `000101`, `10` concat `000101` is `10000101`, convert it to hex is `0x85` not `0x45`, so am I wrong? or you make a mistake?
image

贡献指南

这个仓库没有索引到贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。