~ubuntu-branches/ubuntu/trusty/rhash/trusty

« back to all changes in this revision

Viewing changes to bindings/java/native/digest.h

  • Committer: Package Import Robot
  • Author(s): Aleksey Kravchenko
  • Date: 2013-09-16 19:48:55 UTC
  • mfrom: (1.2.1) (16.1.1 experimental)
  • Revision ID: package-import@ubuntu.com-20130916194855-sengvtinypyl41ld
Tags: 1.3.0-1
* New upstream release version 1.3.0
 - switched the package back to unstable

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
2
 
 * This file is a part of Java Bindings for Librhash
3
 
 * Copyright (c) 2011-2012, Sergey Basalaev <sbasalaev@gmail.com>
4
 
 * Librhash is (c) 2011-2012, Aleksey Kravchenko <rhash.admin@gmail.com>
5
 
 * 
6
 
 * Permission is hereby granted, free of charge,  to any person obtaining a copy
7
 
 * of this software and associated documentation files (the "Software"), to deal
8
 
 * in the Software without restriction,  including without limitation the rights
9
 
 * to  use,  copy,  modify,  merge, publish, distribute, sublicense, and/or sell
10
 
 * copies  of  the Software,  and  to permit  persons  to whom  the Software  is
11
 
 * furnished to do so.
12
 
 * 
13
 
 * This library  is distributed  in the hope that it will be useful, but WITHOUT
14
 
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
15
 
 * FOR A PARTICULAR PURPOSE. Use it at your own risk!
16
 
 */
17
 
 
18
 
/* This is convenient structure to hold message digest. */
19
 
 
20
 
#ifndef DIGEST_H
21
 
#define DIGEST_H
22
 
 
23
 
typedef struct {
24
 
        int hash_id;
25
 
        size_t hash_len;
26
 
        unsigned char *hash_data;
27
 
} DigestStruct;
28
 
 
29
 
typedef DigestStruct* Digest;
30
 
 
31
 
/**
32
 
 * Frees memory occupated by Digest.
33
 
 * @param  obj  object to free
34
 
 */
35
 
void freeDigest(Digest obj);
36
 
 
37
 
/**
38
 
 * Compares two Digest instances.
39
 
 * @param  obj1  first object to compare
40
 
 * @param  obj2  second object to compare
41
 
 * @return  1 if objects are equal, 0 otherwise
42
 
 */
43
 
int compareDigests(Digest obj1, Digest obj2);
44
 
 
45
 
/**
46
 
 * Calculates hashcode for Digest.
47
 
 * @param  obj  object to calculate hash code
48
 
 */
49
 
int hashcodeForDigest(Digest obj);
50
 
 
51
 
#endif /* DIGEST_H */