二进制安全

关于这个词,解释的应该很多,不管是密码学还是文件什么的,这次想说的是关于代码是二进制安全的,比如这句Redis 的字符串表示还应该是二进制安全的:

这里的二进制安全是什么意思呢?

感觉wiki里这个解释的还是比较清楚的:

Binary-safe is a computer programming term mainly used in connection with string manipulating functions. A binary-safe function is essentially one that treats its input as a raw stream of data without any specific format. It should thus work with all 256 possible values that a character can take (assuming 8-bit characters).


二进制安全是一个主要用来处理字符串操作的编程术语。二进制安全功能本质上是把输入当作一个没有任何特殊的原生流,其在操作上应包含一个字符所能有的256种可能的值(假设为8为字符)。


这样理解的话,我们可以知道char 数组 是以 \0 结尾的,这应该不属于二进制安全的。


以上的理解不知道是不是妥当,有懂的话,求指导



你可能感兴趣的:(二进制安全)