GNU Octave  8.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-2023 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 
42 OCTAVE_API int md2_digest_size (void);
43 OCTAVE_API int md4_digest_size (void);
44 OCTAVE_API int md5_digest_size (void);
45 OCTAVE_API int sha1_digest_size (void);
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 
65 
66 #endif
OCTAVE_END_NAMESPACE(octave)
OCTAVE_BEGIN_NAMESPACE(octave) static octave_value daspk_fcn
OCTAVE_API int sha256_digest_size(void)
Definition: lo-hash.cc:65
OCTAVE_API int md2_digest_size(void)
Definition: lo-hash.cc:60
OCTAVE_API int md4_digest_size(void)
Definition: lo-hash.cc:61
OCTAVE_API std::string sha512_hash(const std::string &str)
Definition: lo-hash.cc:112
OCTAVE_API std::string sha1_hash(const std::string &str)
Definition: lo-hash.cc:88
OCTAVE_API std::string hash(hash_fptr hash_fcn, const std::string &str, int result_buf_len)
Definition: lo-hash.cc:45
OCTAVE_API std::string md2_hash(const std::string &str)
Definition: lo-hash.cc:70
OCTAVE_API std::string md4_hash(const std::string &str)
Definition: lo-hash.cc:76
OCTAVE_API int sha512_digest_size(void)
Definition: lo-hash.cc:67
OCTAVE_API int md5_digest_size(void)
Definition: lo-hash.cc:62
OCTAVE_API std::string md5_hash(const std::string &str)
Definition: lo-hash.cc:82
OCTAVE_API std::string sha384_hash(const std::string &str)
Definition: lo-hash.cc:106
void *() hash_fptr(const char *buffer, std::size_t len, void *res)
Definition: lo-hash.h:37
OCTAVE_API std::string sha256_hash(const std::string &str)
Definition: lo-hash.cc:100
OCTAVE_API int sha1_digest_size(void)
Definition: lo-hash.cc:63
OCTAVE_API std::string sha224_hash(const std::string &str)
Definition: lo-hash.cc:94
OCTAVE_API int sha224_digest_size(void)
Definition: lo-hash.cc:64
OCTAVE_API int sha384_digest_size(void)
Definition: lo-hash.cc:66
#define OCTAVE_API
Definition: main.in.cc:55
F77_RET_T len
Definition: xerbla.cc:61