]>
Commit | Line | Data |
---|---|---|
007e0753 | 1 | /* |
359fc2d2 | 2 | * Copyright (C) the libgit2 contributors. All rights reserved. |
bb742ede VM |
3 | * |
4 | * This file is part of libgit2, distributed under the GNU GPL v2 with | |
5 | * a Linking Exception. For full terms see the included COPYING file. | |
007e0753 RJ |
6 | */ |
7 | #ifndef INCLUDE_hash_h__ | |
8 | #define INCLUDE_hash_h__ | |
9 | ||
44908fe7 | 10 | #include "git2/oid.h" |
007e0753 | 11 | |
d6fb0924 | 12 | typedef struct git_hash_prov git_hash_prov; |
007e0753 RJ |
13 | typedef struct git_hash_ctx git_hash_ctx; |
14 | ||
7ebefd22 | 15 | int git_hash_global_init(void); |
a8527429 | 16 | void git_hash_global_shutdown(void); |
7ebefd22 | 17 | |
603bee07 ET |
18 | int git_hash_ctx_init(git_hash_ctx *ctx); |
19 | void git_hash_ctx_cleanup(git_hash_ctx *ctx); | |
20 | ||
d6fb0924 ET |
21 | #if defined(OPENSSL_SHA1) |
22 | # include "hash/hash_openssl.h" | |
23 | #elif defined(WIN32_SHA1) | |
24 | # include "hash/hash_win32.h" | |
d6fb0924 ET |
25 | #else |
26 | # include "hash/hash_generic.h" | |
27 | #endif | |
28 | ||
007e0753 RJ |
29 | typedef struct { |
30 | void *data; | |
31 | size_t len; | |
32 | } git_buf_vec; | |
33 | ||
d6fb0924 ET |
34 | int git_hash_update(git_hash_ctx *c, const void *data, size_t len); |
35 | int git_hash_final(git_oid *out, git_hash_ctx *c); | |
007e0753 | 36 | |
d6fb0924 ET |
37 | int git_hash_buf(git_oid *out, const void *data, size_t len); |
38 | int git_hash_vec(git_oid *out, git_buf_vec *vec, size_t n); | |
007e0753 RJ |
39 | |
40 | #endif /* INCLUDE_hash_h__ */ |