antirez / antirez/listpack

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

Aperta
#2 3 commenti 2 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
C
Stelle
98
Fork
18
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

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

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.