What is the difference between binary safe strings and binary unsafe strings?

I read the redis manifest [1] and it seems that redis only accepts binary safe strings as keys, but I don't know the difference between them. Can someone explain with an example?

[1] http://oldblog.antirez.com/post/redis-manifesto.html

+4
source share
2 answers

I am not familiar with the system in question, but the term “binary safe string” can be used either to describe certain types of string storage, or to describe specific string instances. In a binary-safe string type, a string of length N can be used to encapsulate any sequence of N values ​​in the range 0-255 or 0-65535 (respectively for 8- or 16-bit types). A binary safe string instance may be one whose presentation can be subdivided into parts of uniform size, each part representing a single character, as opposed to a string instance in which different characters require different amounts of storage space.

( ) , , . , " ", , " ". , , , , N- N- , N- , , , , 8- 12- 13- .

, , , redis , , , , , , , , . , , , : (1) , ; (2) , , .

+4

Redis, Redis "+redis_response\r\n", Redis "$str_len\r\nbinary_safe_string\r\n". , Redis , , "foo", 512MB, , JEPG. , , - , NULL C, '\0.

, Swanand

+7

All Articles