Jump to content

Octet String


Jenski

Recommended Posts

An octet means a group of 8 (from Greek okta-). An eight-digit unsigned binary number has the range [0,111111112]=[0,25510], so assuming that each 255 in your string is in base 2 and then converted to base 10, each group is one octet, i.e. one byte.

 

I'm not sure what a "sensible format" would constitute. Your string is just a space delimited numbers.

Link to comment
https://forums.phpfreaks.com/topic/151032-octet-string/#findComment-793641
Share on other sites

"Sensible format" = base10 value...

 

255 octal = 10101101 binary

10101101 = 173 decimal

 

"255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255"

"173 173 173 173 173 173 173 173 173 173 173 173 173 173 173 173 173 173 173 173 173"

 

if the spaces are delimiters what do I do with the numbers? any ideas?

Link to comment
https://forums.phpfreaks.com/topic/151032-octet-string/#findComment-794297
Share on other sites

"Sensible format" = base10 value...

 

How do you know they aren't already base 10? It wouldn't make sense calling it an "octet string" for other bases than 10. The words "octet" and "octal" aren't the same. "Octet" means a group of 8, while octet is the just the positional number system with the base 8.

 

It makes sense that your 255's is in decimal. If you assume that it's the highest value then if you convert it to hex you'll have FF16, but that's only two digits. If you convert it to octal then you'll get 3778, but that's only three digits. However, if you convert it to binary then you'll get 111111112, that's eight digits, i.e. an octet of digits.

 

if the spaces are delimiters what do I do with the numbers? any ideas?

 

You'll probably have to lookup what that string means in the docs from where it came from.

Link to comment
https://forums.phpfreaks.com/topic/151032-octet-string/#findComment-794540
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.