What is the fulldirhash algorithm??

Gary Mills mills at cc.umanitoba.ca
Tue Jul 6 12:08:00 EDT 2004

On Tue, Jul 06, 2004 at 08:08:19AM -0700, Rob Tanner wrote:
>    I need to move a number of mailboxes onto a system runng Cyrus IMAP4
>    v2.2.3 with fulldirhash.  Adding them to the mailboxes database is not
>    a problem.  But what I need to know is where to put them, and that's
>    decided by the hashing algorithm.  I could probably figure it out by
>    digging through the source code, but if someone could lay it out in a
>    sentence or two, that would save me oodles of time, and I'd appreciate
>    it.

The best way to do this is to do it through IMAP, and let the server
calculate the hash characters and update various databases.  However,
here's a bit of perl that describes the full hash algorithm:

        $n = 0;
        foreach my $b (split(/ */, $name)) {
            $n = (($n << 3) ^ ($n >> 5)) ^ ord($b);
        $h = chr(ord('A') + ($n % 23));

-Gary Mills-    -Unix Support-    -U of M Academic Computing and Networking-
Cyrus Home Page: http://asg.web.cmu.edu/cyrus
Cyrus Wiki/FAQ: http://cyruswiki.andrew.cmu.edu
List Archives/Info: http://asg.web.cmu.edu/cyrus/mailing-list.html

More information about the Info-cyrus mailing list