It is currently Mon Jan 25, 2021 9:17 am

All times are UTC + 1 hour




Post new topic Reply to topic  [ 17 posts ]  Go to page Previous  1, 2
Author Message
 Post subject: Re: HEX string generating - extreme fast
PostPosted: Thu Nov 07, 2019 4:26 pm 
Offline
PureBasic Expert
PureBasic Expert

Joined: Sun Aug 08, 2004 5:21 am
Posts: 3710
Location: Netherlands
swhite wrote:
I would be helpful to have a PokeH() function as well that takes a Hex string and converts it to the binary ascii values. :)

There should be code on the forum like that.
What's important in this case is to decide if validation of the input is required.
If you know for sure that the input only contains hex characters, conversion can be done a lot faster compared to having to check each character and stop the conversion when a non hex character is encountered.

_________________
macOS 10.15 Catalina, Windows 10


Top
 Profile  
Reply with quote  
 Post subject: Re: HEX string generating - extreme fast
PostPosted: Thu Nov 07, 2019 5:28 pm 
Offline
Addict
Addict

Joined: Thu Jun 07, 2007 3:25 pm
Posts: 3967
Location: Berlin, Germany
wilbert wrote:
swhite wrote:
I would be helpful to have a PokeH() function as well that takes a Hex string and converts it to the binary ascii values. :)

There should be code on the forum like that.
I have posted functions PeekHexBytes() and PokeHexBytes() more than 9 years ago. :-)
That thread also contains code by other forum members.

wilbert wrote:
What's important in this case is to decide if validation of the input is required.
If you know for sure that the input only contains hex characters, conversion can be done a lot faster compared to having to check each character and stop the conversion when a non hex character is encountered.
Both above mentioned functions are not optimized for speed, but written with safety and versatility in mind (however, I tried not to slow them down unnecessarily). This means that PokeHexBytes() does validate its input.

_________________
Please excuse my flawed English. My native language is PureBasic.
Search
RSBasic's backups


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 17 posts ]  Go to page Previous  1, 2

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 19 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  

 


Powered by phpBB © 2008 phpBB Group
subSilver+ theme by Canver Software, sponsor Sanal Modifiye