Octet String: What is it?

"Octet" is standardese for "8-bit byte". It's supposed to be a less ambiguous term compared to just "byte", because some platforms have bytes of different width (not sure if there are any are still remaining, but they used to exist).


Suppose a representation of binary 00000000 to 11111111 as 0x00 to 0xFF in hexadecimal. Then the octetString is simply 00 to FF.

Combining several octets to a string is then like 0x00 0x01 0x02 ... or simply 000102.. as an octetstring.

Binary files can be encoded into octetstrings and sent from a webbclient to a server in the form of an ASCII-string containing the 0-F alphabet, like a8b9457fc6e3e410589f or it's capitals. There are javascript using BASE-64 encoding used to store pictures in Strings. The larger alphabet, in this case(I think ) A-Z,a-z,0-9, the less data needs to be transferred. every octet has 256 different possible values, and are to be stored in an alphabet of 62 letters, clearly one needs to use more than one letter / octet. Possibly the theoretical number is proportional to log62(256).

The conclusion is that improved readability takes more space than it's binary version, in the octetstream example it's twice as long since each ascii char is eight bits and 2 chars (16 bits) represent an octet which is eight bits. Quite inefficient.


Octet = byte.

Octet string = sequence of bytes.

Also, see Wikipedia.

Tags:

Networking