I want to store data in redis using bitfield. The string I get is "|\x00\x82" I tried converting ASCII characters to binary with this
for (let i = 0; i < map.length; i++) {
let byte = map[i].charCodeAt(0).toString(2).padStart(8, "0");
bString += byte;
}
The result of this is 01111100 00000000 11111111 11111101 But there are only three characters in the string. the first two match and I don't know what are the other two. It doesn't even change when i try to store something else yet in redis-cli it changes. I noticed that this happens when the most significant bit is 1. I tried it with unsigned and signed integer.