View Single Post
  #18 (permalink)  
Old 06-02-2008, 07:26 PM
agraham's Avatar
agraham agraham is offline
Basic4ppc Expert
 
Join Date: Jul 2007
Location: Cheshire, UK
Posts: 1,902
Awards Showcase
Beta Tester Forum Contributer 
Total Awards: 2
Default

Quote:
Originally Posted by Arrie View Post
we must use a prefix zero if the secret datapacket is smaller then 16(dec) or F(hex), is this correct ?
Actually smaller than 16(dec) = 10(hex). As the conversion from hex back to bytes assumes each byte is represented by a 2 character hex number then the original byte to hex must make sure that each bytes maps to a 2 character hex number. The library only produces a single hex character for values less than 16 so the "0" needs to be added to make it 2 characters.

Quote:
And if so is this than a bug or just stupid programming from me
Neither, just a "feature" of the library you didn't know about.
Reply With Quote