Re: Perl version of dir_hash_c

2011-07-27 Thread Bron Gondwana
On Thu, Jul 28, 2011 at 03:31:39AM +0600, subscript...@innter.net wrote: > Bron Gondwana wrote : > > > I think it's the 32bit vs 64bit issue. There's an open bug for it in > > bugzilla. > > Thanks for info. I found this bug (3381). But now I have another question. > I have 2 alternatives. > > 1

Re: Perl version of dir_hash_c

2011-07-27 Thread subscription
Bron Gondwana wrote : > I think it's the 32bit vs 64bit issue. There's an open bug for it in > bugzilla. Thanks for info. I found this bug (3381). But now I have another question. I have 2 alternatives. 1. I can change perl script that to use 32bit int (thanks to Leena Heino). 2. I can use patc

Re: Perl version of dir_hash_c

2011-07-27 Thread Leena Heino
On Wed, 27 Jul 2011, subscript...@innter.net wrote: > Hello, > > I have found that C and Perl versions (tools/rehash) of dir_hash_c have > different results. For part of mailboxes. > > Perl code : > > $n = 0; > foreach my $b (split(/ */, $auth_user)) { >$n = (($n << 3) ^ ($n >> 5)) ^ ord($b);

Re: Perl version of dir_hash_c

2011-07-26 Thread Bron Gondwana
On Wed, Jul 27, 2011 at 03:22:05AM +0600, subscript...@innter.net wrote: > This is wrong. > Can someone explain that is wrong in perl version and how to fix this? I think it's the 32bit vs 64bit issue. There's an open bug for it in bugzilla. (personally, I think fulldirhash is wrong, but that's

Perl version of dir_hash_c

2011-07-26 Thread subscription
Hello, I have found that C and Perl versions (tools/rehash) of dir_hash_c have different results. For part of mailboxes. Perl code : $n = 0; foreach my $b (split(/ */, $auth_user)) { $n = (($n << 3) ^ ($n >> 5)) ^ ord($b); } $h = chr(ord('A') + ($n % 23)); ./mbpath user.biz53p2 Result : A