GNU Octave  9.1.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-2024 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 
34 
36 
37 typedef void *(hash_fptr) (const char *buffer, std::size_t len, void *res);
38 
39 OCTAVE_API std::string
40 hash (hash_fptr hash_fcn, const std::string& str, int result_buf_len);
41 
50 
51 OCTAVE_API std::string md2_hash (const std::string& str);
52 OCTAVE_API std::string md4_hash (const std::string& str);
53 OCTAVE_API std::string md5_hash (const std::string& str);
54 OCTAVE_API std::string sha1_hash (const std::string& str);
55 OCTAVE_API std::string sha224_hash (const std::string& str);
56 OCTAVE_API std::string sha256_hash (const std::string& str);
57 OCTAVE_API std::string sha384_hash (const std::string& str);
58 OCTAVE_API std::string sha512_hash (const std::string& str);
59 
60 OCTAVE_API std::string
61 hash (const std::string& hash_type, const std::string& str);
62 
63 OCTAVE_END_NAMESPACE(crypto)
64 OCTAVE_END_NAMESPACE(octave)
65 
66 #endif
OCTAVE_BEGIN_NAMESPACE(octave) static octave_value daspk_fcn
std::string hash(hash_fptr hash_fcn, const std::string &str, int result_buf_len)
Definition: lo-hash.cc:45
int md2_digest_size()
Definition: lo-hash.cc:60
std::string md2_hash(const std::string &str)
Definition: lo-hash.cc:70
std::string sha256_hash(const std::string &str)
Definition: lo-hash.cc:100
std::string sha512_hash(const std::string &str)
Definition: lo-hash.cc:112
std::string sha384_hash(const std::string &str)
Definition: lo-hash.cc:106
int sha256_digest_size()
Definition: lo-hash.cc:65
int md5_digest_size()
Definition: lo-hash.cc:62
int sha512_digest_size()
Definition: lo-hash.cc:67
int sha1_digest_size()
Definition: lo-hash.cc:63
std::string sha224_hash(const std::string &str)
Definition: lo-hash.cc:94
std::string sha1_hash(const std::string &str)
Definition: lo-hash.cc:88
int md4_digest_size()
Definition: lo-hash.cc:61
void *() hash_fptr(const char *buffer, std::size_t len, void *res)
Definition: lo-hash.h:37
std::string md4_hash(const std::string &str)
Definition: lo-hash.cc:76
int sha384_digest_size()
Definition: lo-hash.cc:66
int sha224_digest_size()
Definition: lo-hash.cc:64
std::string md5_hash(const std::string &str)
Definition: lo-hash.cc:82
#define OCTAVE_API
Definition: main.cc:55
F77_RET_T len
Definition: xerbla.cc:61