splitting a block of 256 bytes in 64 values
Posted: Sun Jun 14, 2015 8:20 am
I have 64 16 bit numbers which I convert to a HEX format.
The HEX format will consist of 4 bytes with ASCII characters.
In this way, it is good to process the data to eventually again to have a decimal number.
I ask every time 64 values so 256 bytes at a time.
1) I divide it into sections of 256 bytes 32 bytes. (splitter looks only to the first 50 elements so I have to split)
2) then I divide it into portions of 4 bytes
3) this HEX value I turn then to a decimal value
However, this module is large and slow. I think it can be easily solved with a Ruby module.
I have a ruby module that views 64 values as lines on display and it should be easy in ruby to split fast the 256 Bytes in 64 values (I think).
I am a C programmer and am trying to use ruby but not quite succeed... (I'm working on it!!
)
can anyone push me in the right direction to make a good start to accelerate this module in Ruby.
Or am I mistaken and this module can not faster?
The HEX format will consist of 4 bytes with ASCII characters.
In this way, it is good to process the data to eventually again to have a decimal number.
I ask every time 64 values so 256 bytes at a time.
1) I divide it into sections of 256 bytes 32 bytes. (splitter looks only to the first 50 elements so I have to split)
2) then I divide it into portions of 4 bytes
3) this HEX value I turn then to a decimal value
However, this module is large and slow. I think it can be easily solved with a Ruby module.
I have a ruby module that views 64 values as lines on display and it should be easy in ruby to split fast the 256 Bytes in 64 values (I think).
I am a C programmer and am trying to use ruby but not quite succeed... (I'm working on it!!
can anyone push me in the right direction to make a good start to accelerate this module in Ruby.
Or am I mistaken and this module can not faster?