Consider the extract from a capture below
When I copy the Registrar Nonce value "3aa9df80bb73ae86a2acb5724da5ad96" and store it in a file in linux..the file size reads 32 bytes instead of 16 bytes (according to the Data Element Length value)..? Which value is correct 16 bytes or 32 bytes? asked 28 Mar '15, 14:53 Jay Dee |
One Answer:
Each byte is represented by two hexadecimal characters. For example the most significant byte in your Nonce as the decimal value 58, which is 3a in hexadecimal. So the correct value is 16 bytes. answered 28 Mar '15, 15:56 Pascal Quantin |
thanks for explaining this..so the value "3aa9df80bb73ae86a2acb5724da5ad96" is equal to 32 bytes when stored in a file..is this because each character is considered a byte in the file?
It depends on the encoding used in the file, e.g. using UTF-8 as I think is common on Linux, each hex character is stored as 1 byte, but if using something such as UCS-2, as is common on Windows then there would be two bytes per character (plus a BOM at the front of the file).
In the packet the binary element is 16 bytes, if yo copy the text representation which is 32 characters and paste it into a text file the length of the text file will be at least 32 bytes depending on how the binary representation of that text string is encoded in the text file.
thank You grahamb and Anders!!