What is a binary safe string ? Is it just a string with length attached in the string itself ? Why are they called binary safe then ? Not sure that I should tag redis, but read this term while reading redis doc.
A binary-safe function is a function or operation that can be performed on a binary file without modifying the contents of the file. This ensures that the file is not corrupted or mutilated by the function or operation.
Binary safety is a property of functions which means they process any string correctly. The converse would be a string that contains only ASCII characters and no null characters - such a string should be processed correctly by any function.
Redis keys are binary safe, this means that you can use any binary sequence as a key, from a string like "foo" to the content of a JPEG file. The empty string is also a valid key.
A binary safe string is one that can consist of any characters (bytes).
For example, many programming languages use the 0x00 character as an end-of-string marker, so in that sense a binary safe string is one that can consist of these.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With