1 /*
2  * Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
3  * Use is subject to license terms.
4  */
5 
6 /*
7  * lib/krb5/rcache/rc_common.c
8  *
9  * This file of the Kerberos V5 software is derived from public-domain code
10  * contributed by Daniel J. Bernstein, <brnstnd@acf10.nyu.edu>.
11  *
12  */
13 
14 /*
15  * An implementation for the common replay cache functions.
16  */
17 #include "rc_common.h"
18 
19 /*
20  * Local stuff:
21  *
22  * static int hash(krb5_donot_replay *rep, int hsize)
23  *  returns hash value of *rep, between 0 and hsize - 1
24  */
25 
26 int
hash(krb5_donot_replay * rep,int hsize)27 hash(krb5_donot_replay *rep, int hsize)
28 {
29 	return ((int)((((rep->cusec + rep->ctime + *rep->server + *rep->client)
30 	    % hsize) + hsize) % hsize));
31 }
32