fjckls Posted October 18, 2011 Report Share Posted October 18, 2011 Man ir jāatrisina šāds te: Before calculating the MD5 hash, string should most likely be converted to a byte array: when doing so, it should be treated as 7-bit ASCII. After calculating the MD5 hash, the resulting byte array containing the hash is base-64 encoded. For example: BASE64(MD5(TEST1234|MM00402320|MDB@INTERMEZZOGROUP.COM|PREVIEW)) = zqdmWws60Bq80I2RFkgW1Q== Izmeklējos un netieku gudrs kā iespējams "string should most likely be converted to a byte array", Pagaidu kods, kas nestrādā: <?php $one = "TEST1234"; $two = "MM00402320"; $three = "MDB@INTERMEZZOGROUP.COM"; $four = "PREVIEW))"; $strng = $one . "|" . $two . "|" . $three . "|" . $four; $hash = base64_encode(md5($strng)); echo $hash; // NjNhZjFmN2NmMGY1NjU0NjE1MmZlMTIyMzRkZjdkMGY= bet jaabuut zqdmWws60Bq80I2RFkgW1Q== ?> Hmm.. kādas idejas? PAldies! Quote Link to comment Share on other sites More sharing options...
briedis Posted October 18, 2011 Report Share Posted October 18, 2011 Hmm, man liekas, ka tas nav iespejams. md5 atgriež 32 simbolus, base64 overheads ir ~33% Nav iespējams iegūt īsāku virkni par to, kas tiek dota. Quote Link to comment Share on other sites More sharing options...
marrtins Posted October 18, 2011 Report Share Posted October 18, 2011 1) $four ir jābūt bez )) 2) md5($str, true); string md5 ( string $str [, bool $raw_output = false ] ) Quote Link to comment Share on other sites More sharing options...
codez Posted October 18, 2011 Report Share Posted October 18, 2011 http://codepad.org/kzETxou8 Quote Link to comment Share on other sites More sharing options...
fjckls Posted October 25, 2011 Author Report Share Posted October 25, 2011 http://codepad.org/kzETxou8 paldies :) Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.