OpenCPN Partial API docs
Loading...
Searching...
No Matches
FlexHash.h
1
2/******************************************************************************
3 *
4 * Project: OpenCPN
5 * Purpose: Hash of arbitrary length
6 * Author: Anton Samsonov
7 *
8 ***************************************************************************
9 * Copyright (C) 2010 by David S. Register *
10 * *
11 * This program is free software; you can redistribute it and/or modify *
12 * it under the terms of the GNU General Public License as published by *
13 * the Free Software Foundation; either version 2 of the License, or *
14 * (at your option) any later version. *
15 * *
16 * This program is distributed in the hope that it will be useful, *
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
19 * GNU General Public License for more details. *
20 * *
21 * You should have received a copy of the GNU General Public License *
22 * along with this program; if not, write to the *
23 * Free Software Foundation, Inc., *
24 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
25 ***************************************************************************
26 *
27 */
28
29#ifndef __FLEXHASH_H__
30#define __FLEXHASH_H__
31
32#include <vector>
33#include "ssl/sha1.h"
34
38class FlexHash {
39public:
40 FlexHash(size_t output_octets);
41
42 void Reset(void);
43 void Update(const void* input, size_t input_octets);
44 void Finish(void);
45 void Receive(void* output);
46
47 void Compute(const void* input, size_t input_octets, void* output);
48 static void Compute(const void* input, size_t input_octets, void* output,
49 size_t output_octets);
50
51 static bool Test(void);
52
53protected:
54 sha1_context m_Context;
55 std::vector<unsigned char> m_Output;
56};
57
58#endif
A class for computing hash of arbitrary length.
Definition FlexHash.h:38