Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
PHP Pack() and unpack()
Old 12-15-2010, 04:11 AM PHP Pack() and unpack()
WebAvenger's Avatar
Junior Talker

Posts: 4
Location: Australia, Sydney
Trades: 0
Hi , i am currently learning about mcrypt and all its functions, until i came across the "pack()" function in my ebook. The book hashes the encryption key then packs it .e.g.

$encryptionKey = pack('H*', $md5InputKey)

Then the book says the hash hexadecimal value is converted into binary data, so that each byte has a full 256-bit range of values.

I dont understand this explanation. full 256-range of values ? how does that work? Can anyone shed any light on this ? plus, can anyone tell me why someone would use pack and unpack, is there an advantage to converting data into binary format?

Any help is greatly appreciated , thank you.
WebAvenger is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 12-15-2010, 05:20 AM Re: PHP Pack() and unpack()
Super Spam Talker

Posts: 879
Name: Paul W
Trades: 0
I've used pack and unpack when working with binary files - very useful, if fiddly.
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE


*** New:
Please login or register to view this content. Registration is FREE
PaulW is offline
Reply With Quote
View Public Profile
 
Old 12-15-2010, 07:27 AM Re: PHP Pack() and unpack()
Junior Talker

Posts: 2
Name: mecan steve
Trades: 0
I agree with PaulW.
mecansteve is offline
Reply With Quote
View Public Profile
 
Old 12-15-2010, 04:34 PM Re: PHP Pack() and unpack()
WebAvenger's Avatar
Junior Talker

Posts: 4
Location: Australia, Sydney
Trades: 0
Why do people use/work with binary files? any advantages ?
WebAvenger is offline
Reply With Quote
View Public Profile
 
Old 12-15-2010, 07:37 PM Re: PHP Pack() and unpack()
Super Spam Talker

Posts: 879
Name: Paul W
Trades: 0
Quote:
Originally Posted by WebAvenger View Post
Why do people use/work with binary files? any advantages ?
Sometimes you're given binary files and/or required to produce them -- no choice.
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE


*** New:
Please login or register to view this content. Registration is FREE
PaulW is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to PHP Pack() and unpack()
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

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





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.15373 seconds with 12 queries