Author

Topic: Really simple question (Read 195 times)

legendary
Activity: 3808
Merit: 7912
January 31, 2019, 10:53:53 PM
#5
Ahhhh damn ok thanks for pointing it out to me, I'm bad at thinking about encoding stuff. Thanks.

 Not too many are good at thinking about encoding so it's understandable.  Kudos to you for learning.

legendary
Activity: 2534
Merit: 6080
Self-proclaimed Genius
January 31, 2019, 10:50:00 PM
#4
One character is one byte & one byte is 8 bits alright, but it will make him more puzzled by that explanation.
1HEX (00 to FF)=8bits (00000000 to 11111111)=1byte; 1HEX=1Byte.

Where it gone wrong is how the text editor "counts" HEX.
If it was a text editor (example for hex, raw tx), it reads each of the characters as "characters" which is one byte each.

Now, RPC call counts HEX as "HEX" thus each of the two characters were counted as one byte.
That why it's exactly half of the size counted by a text editor like "notepad".
newbie
Activity: 9
Merit: 4
January 31, 2019, 10:44:09 PM
#3
Ahhhh damn ok thanks for pointing it out to me, I'm bad at thinking about encoding stuff. Thanks.
legendary
Activity: 3808
Merit: 7912
January 31, 2019, 10:22:02 PM
#2
First of all, you are mistaken to think that one character equals one byte so your conclusions will be incorrect as well.

One byte is equal to eight bits and it takes two characters to represent one byte in hexadecimal format.

 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F 10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F 20 21 22 23...
 ...F0 F1 F2 F3 F4 F5 F6 F7 F8 F9 FA FB FC FD FE FF

 I'm sure you already knew that but your initial premise threw off your thinking.


newbie
Activity: 9
Merit: 4
January 31, 2019, 10:10:58 PM
#1
Hi. This is a dumb question but, how come when I copy a value from bitcoin, e.g. raw hex of a tx, and paste it in a text editor and read the length, it reads 600 chars (bytes), but when I look in the RPC result for size it reads exactly half of that (300) ? Thanks.
Jump to: