GNU Octave  4.4.1
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-2018 John W. Eaton
4 
5 This file is part of Octave.
6 
7 Octave is free software: you can redistribute it and/or modify it
8 under the terms of the GNU General Public License as published by
9 the Free Software Foundation, either version 3 of the License, or
10 (at your option) any later version.
11 
12 Octave is distributed in the hope that it will be useful, but
13 WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
16 
17 You should have received a copy of the GNU General Public License
18 along with Octave; see the file COPYING. If not, see
19 <https://www.gnu.org/licenses/>.
20 
21 */
22 
23 #if ! defined (octave_lo_hash_h)
24 #define octave_lo_hash_h 1
25 
26 #include "octave-config.h"
27 
28 #include <string>
29 
30 namespace octave
31 {
32  namespace crypto
33  {
34  typedef void * (hash_fptr) (const char *buffer, size_t len, void *res);
35 
37  hash (hash_fptr hash_fcn, const std::string& str, int result_buf_len);
38 
39  int md2_digest_size (void);
40  int md4_digest_size (void);
41  int md5_digest_size (void);
42  int sha1_digest_size (void);
43  int sha224_digest_size (void);
44  int sha256_digest_size (void);
45  int sha384_digest_size (void);
46  int sha512_digest_size (void);
47 
56 
58  }
59 }
60 
61 #endif
std::string hash(hash_fptr hash_fcn, const std::string &str, int result_buf_len)
Definition: lo-hash.cc:42
std::string sha512_hash(const std::string &str)
Definition: lo-hash.cc:109
std::string md4_hash(const std::string &str)
Definition: lo-hash.cc:73
int sha384_digest_size(void)
Definition: lo-hash.cc:63
int sha512_digest_size(void)
Definition: lo-hash.cc:64
int sha224_digest_size(void)
Definition: lo-hash.cc:61
void *() hash_fptr(const char *buffer, size_t len, void *res)
Definition: lo-hash.h:34
int md5_digest_size(void)
Definition: lo-hash.cc:59
std::string str
Definition: hash.cc:118
int md2_digest_size(void)
Definition: lo-hash.cc:57
int md4_digest_size(void)
Definition: lo-hash.cc:58
std::string md5_hash(const std::string &str)
Definition: lo-hash.cc:79
OCTAVE_EXPORT octave_value_list Fhash(const octave_value_list &args, int) the SHA-1 hash value is calculated with nd group nd example nd deftypefn *std::string hash_type
Definition: hash.cc:117
std::string md2_hash(const std::string &str)
Definition: lo-hash.cc:67
int sha256_digest_size(void)
Definition: lo-hash.cc:62
std::string sha1_hash(const std::string &str)
Definition: lo-hash.cc:85
std::string sha256_hash(const std::string &str)
Definition: lo-hash.cc:97
std::string sha384_hash(const std::string &str)
Definition: lo-hash.cc:103
If this string is the system will ring the terminal sometimes it is useful to be able to print the original representation of the string
Definition: utils.cc:888
std::string sha224_hash(const std::string &str)
Definition: lo-hash.cc:91
int sha1_digest_size(void)
Definition: lo-hash.cc:60