Newsgroups: fj.lang.c
Path: galaxy.trc.rwcp.or.jp!coconuts.jaist!wnoc-tyo-news!infoweb-news!news.sendai.infoweb.or.jp!news.comtec.co.jp!celery!kishi
From: kishi@pine.sendai.comtec.co.jp (Yasuhiro Kishi)
Subject: hash function
Message-ID: <DK4C6L.1JI@celery.sendai.comtec.co.jp>
Sender: news@celery.sendai.comtec.co.jp (COMTEC News System)
Nntp-Posting-Host: pine
Organization: COMTEC CO., LTD., Sendai City, Miyagi, Japan
X-Newsreader: mnews [version 1.19] 1995-07/21(Fri)
Date: Mon, 25 Dec 1995 01:30:21 GMT
Lines: 26
Xref: galaxy.trc.rwcp.or.jp fj.lang.c:2093
X-originally-archived-at: http://galaxy.rwcp.or.jp/text/cgi-bin/newsarticle2?ng=fj.lang.c&nb=2093&hd=a
X-reformat-date: Mon, 18 Oct 2004 15:18:22 +0900
X-reformat-comment: Tabs were expanded into 4 column tabstops by the Galaxy's archiver. See http://katsu.watanabe.name/ancientfj/galaxy-format.html for more info.

$B%O%C%7%eCM$N>WFM$,:G$b>/$J$$%O%C%7%e4X?t$r8!F$$7$F$$$^$9!%(B

$B4pK\E*$K%A%'%$%sK!$r;H$C$?$b$N$r9M$($F$$$^$9!%(B

#define MAX 100000

int hash(char *str)
{
        int             i = 0;

        while (*str) {
                i += *str;
                str++;
        }

        return i%MAX;
}

$B;EMM$H$7$F$O!$>e5-$N$h$&$K!$F~NO$,J8;zNs$GJV$jCM$,(B log int $B7?$N$b$N$G$9!%(B
$B$3$NNc$G$O3d9g>WFM$,B?$$$N$G$9$,!%!%!%(B

$B2?$+8zN($N$$$$$b$N$r8fB8$8$NJ}!$%U%)%m!]$r$*4j$$CW$7$^$9!%(B
========================================================================
 $B3t<02q<R!!%3%`%F%C%/!!%7%9%F%`3+H/It(B
 $B4_!!9/90(B / COmTEC (kishi@sendai.comtec.co.jp) 
========================================================================
