sewenew / redis-plus-plus

Redis client written in C++
Apache License 2.0
1.6k stars 347 forks source link

Support of binary data #494

Closed ZiroDiv closed 1 year ago

ZiroDiv commented 1 year ago

Currently the redis-plus-plus functions mainly supports Strings It will be nice add support of binary data so no base64 conversion is needed when we need to use binary data (like images, wavs etc) this applies to many features like set/get, pub/sub commands etc

sewenew commented 1 year ago

redis-plus-plus DOES support binary data. Most interfaces take StringView as parameter. You can create a StringView object with binary data's pointer and length.

char *buf; // your binary data's start pointer
size_t len; // length of your binary data.

redis.set("key", StringView(buf, len));

Both key and value can be binary data.

Regards