[prev in list] [next in list] [prev in thread] [next in thread] 

List:       squirrelmail-devel
Subject:    Re: [SM-DEVEL] crc32() in computeHashDirs
From:       "Joseph W. Breu" <breu () cfu ! net>
Date:       2003-03-28 15:40:52
[Download RAW message or body]


I did google, and there were some useful hints - but I couldn't duplicate
the results that I was getting with PHP with any perl app.


>> I tried to find a perl crc32() function that was comparable to the php
>> crc32() call in computeHashDirs().  Does anyone have one?
>
> A Google search finds quite some useful hits.
>
>> Is there any reason why an md5 hash wouldn't work in this case?
>
> Don't know why it shouldn't, but why change it if it works just fine? What
> advantage does using md5 in this case bring us?
>
>
> Thijs
>
>> --- squirrelmail-orig/functions/prefs.php	Thu Jan 23 14:50:22 2003
>> +++ squirrelmail/functions/prefs.php	Tue Feb 18 12:47:14 2003
>> @@ -110,7 +110,10 @@
>>
>>  function computeHashDirs($username) {
>>      /* Compute the hash for this user and extract the hash directories.
>> */
>> -    $hash = base_convert(crc32($username), 10, 16);
>> +    /*
>> +     * changed base_convert hash of crc32 to an md5 sum of the name
>> +     */
>> +    $hash = md5($username);
>>      $hash_dirs = array();
>>      for ($h = 0; $h < 4; ++ $h) {
>>          $hash_dirs[] = substr($hash, $h, 1);
>>
>>
>>
>> -------------------------------------------------------
>> This SF.net email is sponsored by:
>> The Definitive IT and Networking Event. Be There!
>> NetWorld+Interop Las Vegas 2003 -- Register today!
>> http://ads.sourceforge.net/cgi-bin/redirect.pl?keyn0001en
>> --
>> squirrelmail-devel mailing list
>> List Address: squirrelmail-devel@lists.sourceforge.net
>> List Archives:
>> http://sourceforge.net/mailarchive/forum.php?forum_id=7139
>> List Info:
>> https://lists.sourceforge.net/lists/listinfo/squirrelmail-devel
>>
>
>



-------------------------------------------------------
This SF.net email is sponsored by:
The Definitive IT and Networking Event. Be There!
NetWorld+Interop Las Vegas 2003 -- Register today!
http://ads.sourceforge.net/cgi-bin/redirect.pl?keyn0001en
--
squirrelmail-devel mailing list
List Address: squirrelmail-devel@lists.sourceforge.net
List Archives: http://sourceforge.net/mailarchive/forum.php?forum_id=7139
List Info: https://lists.sourceforge.net/lists/listinfo/squirrelmail-devel
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic