GNU Octave  6.2.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
lo-hash.h
Go to the documentation of this file.
1 ////////////////////////////////////////////////////////////////////////
2 //
3 // Copyright (C) 2016-2021 The Octave Project Developers
4 //
5 // See the file COPYRIGHT.md in the top-level directory of this
6 // distribution or <https://octave.org/copyright/>.
7 //
8 // This file is part of Octave.
9 //
10 // Octave is free software: you can redistribute it and/or modify it
11 // under the terms of the GNU General Public License as published by
12 // the Free Software Foundation, either version 3 of the License, or
13 // (at your option) any later version.
14 //
15 // Octave is distributed in the hope that it will be useful, but
16 // WITHOUT ANY WARRANTY; without even the implied warranty of
17 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 // GNU General Public License for more details.
19 //
20 // You should have received a copy of the GNU General Public License
21 // along with Octave; see the file COPYING. If not, see
22 // <https://www.gnu.org/licenses/>.
23 //
24 ////////////////////////////////////////////////////////////////////////
25 
26 #if ! defined (octave_lo_hash_h)
27 #define octave_lo_hash_h 1
28 
29 #include "octave-config.h"
30 
31 #include <string>
32 
33 namespace octave
34 {
35  namespace crypto
36  {
37  typedef void * (hash_fptr) (const char *buffer, size_t len, void *res);
38 
39  std::string
40  hash (hash_fptr hash_fcn, const std::string& str, int result_buf_len);
41 
42  int md2_digest_size (void);
43  int md4_digest_size (void);
44  int md5_digest_size (void);
45  int sha1_digest_size (void);
46  int sha224_digest_size (void);
47  int sha256_digest_size (void);
48  int sha384_digest_size (void);
49  int sha512_digest_size (void);
50 
51  std::string md2_hash (const std::string& str);
52  std::string md4_hash (const std::string& str);
53  std::string md5_hash (const std::string& str);
54  std::string sha1_hash (const std::string& str);
55  std::string sha224_hash (const std::string& str);
56  std::string sha256_hash (const std::string& str);
57  std::string sha384_hash (const std::string& str);
58  std::string sha512_hash (const std::string& str);
59 
60  std::string hash (const std::string& hash_type, const std::string& str);
61  }
62 }
63 
64 #endif
std::string sha384_hash(const std::string &str)
Definition: lo-hash.cc:106
int sha512_digest_size(void)
Definition: lo-hash.cc:67
void *() hash_fptr(const char *buffer, size_t len, void *res)
Definition: lo-hash.h:37
std::string sha1_hash(const std::string &str)
Definition: lo-hash.cc:88
int sha1_digest_size(void)
Definition: lo-hash.cc:63
std::string hash(hash_fptr hash_fcn, const std::string &str, int result_buf_len)
Definition: lo-hash.cc:45
std::string sha512_hash(const std::string &str)
Definition: lo-hash.cc:112
int md2_digest_size(void)
Definition: lo-hash.cc:60
std::string sha224_hash(const std::string &str)
Definition: lo-hash.cc:94
std::string md5_hash(const std::string &str)
Definition: lo-hash.cc:82
std::string sha256_hash(const std::string &str)
Definition: lo-hash.cc:100
int sha256_digest_size(void)
Definition: lo-hash.cc:65
int sha384_digest_size(void)
Definition: lo-hash.cc:66
int sha224_digest_size(void)
Definition: lo-hash.cc:64
int md4_digest_size(void)
Definition: lo-hash.cc:61
int md5_digest_size(void)
Definition: lo-hash.cc:62
std::string md4_hash(const std::string &str)
Definition: lo-hash.cc:76
std::string md2_hash(const std::string &str)
Definition: lo-hash.cc:70
F77_RET_T len
Definition: xerbla.cc:61