TalkPHP
 
 
Account Login
Latest Articles
» The basic usage of PHPTAL, a XML/XHTML template library for PHP
» Vulnerable methods and the areas they are commonly trusted in.
» Simple way to protect a form from bot
» The Basics On: How Session Stealing Works
» How to keep your forms from double posting data
IRC Channel
IRC Speech Bubble Join the friendly bunch on IRC...
(#TalkPHP on Freenode)

...Also available via a web interface.

See this thread for information on the TalkPHP Free Hugs Initiative™. Subject to availability.
Associates
Associates
CSS Tutorials
Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old 10-02-2009, 07:14 PM   #1 (permalink)
The Contributor
 
ioan1k's Avatar
 
Join Date: Mar 2009
Location: US
Posts: 76
Thanks: 0
ioan1k is on a distinguished road
Default Decimal -> Hexidecimal ASCII Conversion

I am currently in need a converting a 128 byte string into a 64 byte hexidecimal string

The way the conversion is to work is by converting each byte of the 128 byte string into a 2 digit hexadecimal character which would equate to 128 / 2 = 64 bytes

The conversion for bytes are 1 byte is equal to 4 Characters so the original string is 512 characters long and the hexadecimal string would be 256 characters long, using these numbers I have tried converting every 4 characters into a hexadecimal but the result is 253 characters and converting that result back results in a different than the original.

An Example would be

Hexidecimal String
Code:
83:4a:9d:04:34:d8:17:73:55:89:f2:2a:46:33:fb:6d:d3:e5:30:db:a1:ea:2b:
bb:9e:1a:cc:b4:38:08:45:13:08:7f:5d:a0:0e:a8:6e:d5:31:64:d8:89:3b:81:
a9:c8:df:65:bc:18:9c:f6:83:0d:27:1e:1a:3e:50:4c:bc:b2:57:14:16:4b:51:
9c:75:f6:e0:ad:f4:1b:b0:7e:7f:8c:4f:b7:b9:96:0d:81:3e:65:77:a7:32:52:
ee:a9:c1:39:cd:da:60:6d:51:12:21:70:e7:16:36:e7:84:91:49:61:8c:82:38:
a2:26:12:88:21:f0:b6:68:49:0b:dc:a8:2f
Orignal String
Code:
3833346139643034333464383137373335353839663232
6134363333666236646433653533306462613165613262
6262396531616363623433383038343531333038376635
6461303065613836656435333136346438383933623831
6139633864663635626331383963663638333064323731
6531613365353034636263623235373134313634623531
3963373566366530616466343162623037653766386334
6662376239393630643831336536353737613733323532
6565613963313339636464613630366435313132323137
3065373136333665373834393134393631386338323338
6132323631323838323166306236363834393062646361
383266
__________________
My Portfolio - Work - Need freelance Work?
I've been developing 5 years now, and I learn something new everyday
ioan1k is offline  
Reply With Quote
Old 10-06-2009, 02:02 PM   #2 (permalink)
The Contributor
 
ioan1k's Avatar
 
Join Date: Mar 2009
Location: US
Posts: 76
Thanks: 0
ioan1k is on a distinguished road
Default

Issue resolved...just used Python & C
__________________
My Portfolio - Work - Need freelance Work?
I've been developing 5 years now, and I learn something new everyday
ioan1k is offline  
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Part 2: Giving our Currency Conversion Script some Responsibility Wildhoney General 15 03-17-2009 01:53 PM


All times are GMT. The time now is 12:02 AM.

 
     

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Inactive Reminders By Icora Web Design