2 * fnv1a.h : routines to create checksums derived from FNV-1a
4 * ====================================================================
5 * Licensed to the Apache Software Foundation (ASF) under one
6 * or more contributor license agreements. See the NOTICE file
7 * distributed with this work for additional information
8 * regarding copyright ownership. The ASF licenses this file
9 * to you under the Apache License, Version 2.0 (the
10 * "License"); you may not use this file except in compliance
11 * with the License. You may obtain a copy of the License at
13 * http://www.apache.org/licenses/LICENSE-2.0
15 * Unless required by applicable law or agreed to in writing,
16 * software distributed under the License is distributed on an
17 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
18 * KIND, either express or implied. See the License for the
19 * specific language governing permissions and limitations
21 * ====================================================================
24 #ifndef SVN_LIBSVN_SUBR_FNV1A_H
25 #define SVN_LIBSVN_SUBR_FNV1A_H
27 #include <apr_pools.h>
29 #include "svn_types.h"
33 #endif /* __cplusplus */
35 /* Opaque FNV-1a checksum creation context type.
37 typedef struct svn_fnv1a_32__context_t svn_fnv1a_32__context_t;
39 /* Return a new FNV-1a checksum creation context allocated in POOL.
41 svn_fnv1a_32__context_t *
42 svn_fnv1a_32__context_create(apr_pool_t *pool);
44 /* Reset the FNV-1a checksum CONTEXT to initial state.
47 svn_fnv1a_32__context_reset(svn_fnv1a_32__context_t *context);
49 /* Feed LEN bytes from DATA into the FNV-1a checksum creation CONTEXT.
52 svn_fnv1a_32__update(svn_fnv1a_32__context_t *context,
56 /* Return the FNV-1a checksum over all data fed into CONTEXT.
59 svn_fnv1a_32__finalize(svn_fnv1a_32__context_t *context);
62 /* Opaque modified FNV-1a checksum creation context type.
64 typedef struct svn_fnv1a_32x4__context_t svn_fnv1a_32x4__context_t;
66 /* Return a new modified FNV-1a checksum creation context allocated in POOL.
68 svn_fnv1a_32x4__context_t *
69 svn_fnv1a_32x4__context_create(apr_pool_t *pool);
71 /* Reset the modified FNV-1a checksum CONTEXT to initial state.
74 svn_fnv1a_32x4__context_reset(svn_fnv1a_32x4__context_t *context);
76 /* Feed LEN bytes from DATA into the modified FNV-1a checksum creation
80 svn_fnv1a_32x4__update(svn_fnv1a_32x4__context_t *context,
84 /* Return the modified FNV-1a checksum over all data fed into CONTEXT.
87 svn_fnv1a_32x4__finalize(svn_fnv1a_32x4__context_t *context);
89 /* Set HASHES to the 4 partial hash sums produced by the modified FVN-1a
90 * over INPUT of LEN bytes.
93 svn__fnv1a_32x4_raw(apr_uint32_t hashes[4],
99 #endif /* __cplusplus */
101 #endif /* SVN_LIBSVN_SUBR_FNV1A_H */