Jump to content

PHP Pack() and unpack()


Web_Avenger

Recommended Posts

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.

 

Link to comment
https://forums.phpfreaks.com/topic/221738-php-pack-and-unpack/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.