Posts: 4,560
Threads: 1,464
Joined: Sep 2016
/dev/urandom is just a test source. the need for this module is to be able to use things that expect data in a different form but with the exact same vales. for example if i have a byte with the value 0xa0 i want to have a character with the value 0xa0. it just needs to be the same. that code seems to be working over the whole range of values and many combinations.
Tradition is peer pressure from dead people
What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
Posts: 4,560
Threads: 1,464
Joined: Sep 2016
Apr-29-2017, 04:40 AM
(This post was last modified: Apr-29-2017, 04:41 AM by Skaperen.)
(Apr-28-2017, 10:54 AM)wavic Wrote: So you don't really care what is printed as long as the value remains untouched?
printing is not the goal. the test code does do printing to see test results.
the first goal is to have consistent 2 digit per unit hexadecimal conversions to/from all character and byte aggregation types.
the 2nd goal is to have type conversion between all character and byte aggregation types that is equivalent to doing the conversion first to hexadecimal and then from there to the other type using the first goal conversions. this may be done by actually using those first goal functions or by using other faster means that has exactly identical results.
it is not intended that this involve any encoding or decoding.
yes, i do understand that 2 digits of hexadecimal means this whole thing only applies to a limited range of values. i may end up wanting to do a larger verion, such as 4 digits of hexadecimal, which will exceed the range of values the units of some types will support.
another goal is to have code work in both python2 and python3 even if that involves testing what version of python is running.
Tradition is peer pressure from dead people
What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.