lujiajing1126 / redis-cli

A Redis-Cli Tool written in typescript for terminal

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Hex is not properly interpreted

stockholmux opened this issue · comments

Hex looks likes it's stored properly, but it isn't.

In real redis-cli:

127.0.0.1:6379> set myhex "\xfe"
OK
127.0.0.1:6379> get myhex
"\xfe"
127.0.0.1:6379> bitfield myhex GET u8 #0 GET u8 #1
1) (integer) 254
2) (integer) 0
127.0.0.1:6379> del myhex
(integer) 1

In this module:

127.0.0.1:6379> set myhex "\xfe"
OK
127.0.0.1:6379> get myhex
\xfe
127.0.0.1:6379> bitfield myhex GET u8 #0 GET u8 #1
(error) result.each is not a function

(The error here is from #14)
If you switch over to real redis-cli and do the bitfield after setting in the module, this is the response that you get:

127.0.0.1:6379> bitfield myhex GET u8 #0 GET u8 #1
1) (integer) 92
2) (integer) 120

So, this module is storing it as a string not bytes.