Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge pull request #2 from mquinson/master
[simgrid.git] / include / xbt / hash.h
1 /* hash.h - Various hashing functions.                                      */
2
3 /* Copyright (c) 2008-2011, 2013-2014. The SimGrid Team.
4  * All rights reserved.                                                     */
5
6 /* This program is free software; you can redistribute it and/or modify it
7  * under the terms of the license (GNU LGPL) which comes with this package. */
8
9 #ifndef XBT_HASH_H
10 #define XBT_HASH_H
11 #include "xbt/str.h"
12
13 SG_BEGIN_DECL()
14
15 /* The classical SHA1 algorithm */
16 typedef struct s_xbt_sha_ s_xbt_sha_t, *xbt_sha_t;
17
18 XBT_PUBLIC(xbt_sha_t) xbt_sha_new(void);
19 XBT_PUBLIC(void) xbt_sha_free(xbt_sha_t sha);
20
21 XBT_PUBLIC(void) xbt_sha_feed(xbt_sha_t sha, const unsigned char *data,
22                               size_t len);
23 XBT_PUBLIC(void) xbt_sha_reset(xbt_sha_t sha);
24
25 XBT_PUBLIC(void) xbt_sha_print(xbt_sha_t sha, char *hash);
26 XBT_PUBLIC(char *) xbt_sha_read(xbt_sha_t sha);
27
28 XBT_PUBLIC(void) xbt_sha(const char *data, char *hash);
29
30 SG_END_DECL()
31
32 #endif                          /* XBT_HASH_H */