summaryrefslogtreecommitdiff
path: root/lang/java/src/com/sleepycat/db/Hasher.java
blob: 28e44995e0ecd4e86a865be499b37b1e2782483d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
/*-
 * See the file LICENSE for redistribution information.
 *
 * Copyright (c) 2000, 2015 Oracle and/or its affiliates.  All rights reserved.
 *
 * $Id$
 */
package com.sleepycat.db;

/**
An application-specified, database hash function.
*/
public interface Hasher {
    /**
    An application-specified, database-specific hash function.
    <p>
    The hash function must handle any key values used by the application
    (possibly including zero-length keys).
    <p>
    @param db
    The enclosing database handle.
    @param data
    The byte string to be hashed.
    @param len
    The length of the byte string in bytes.
    <p>    @return
    The hash value of the byte string.
    */
    int hash(Database db, byte[] data, int len);
}