26 #if defined (HAVE_CONFIG_H)
49 hash_fcn (str.data (), str.length (), result_buf);
51 std::ostringstream buf;
53 for (
int i = 0; i < result_buf_len; i++)
54 buf << std::hex << std::setw (2) << std::setfill (
'0')
55 << (result_buf[i] & 0xFF);
118 hash (
const std::string& hash_type,
const std::string& str)
120 std::string ht = hash_type;
126 else if (ht ==
"MD4")
128 else if (ht ==
"MD5")
130 else if (ht ==
"SHA1")
132 else if (ht ==
"SHA224")
134 else if (ht ==
"SHA256")
136 else if (ht ==
"SHA384")
138 else if (ht ==
"SHA512")
142 (
"hash function '%s' not supported", hash_type.c_str ());
145 OCTAVE_END_NAMESPACE(crypto)
146 OCTAVE_END_NAMESPACE(
octave)
OCTAVE_BEGIN_NAMESPACE(octave) static octave_value daspk_fcn
ColumnVector transform(const Matrix &m, double x, double y, double z)
int octave_sha1_digest_size(void)
int octave_sha256_digest_size(void)
void * octave_sha384_buffer_wrapper(const char *buf, size_t len, void *res)
int octave_sha224_digest_size(void)
void * octave_sha224_buffer_wrapper(const char *buf, size_t len, void *res)
void * octave_sha256_buffer_wrapper(const char *buf, size_t len, void *res)
int octave_sha384_digest_size(void)
int octave_md5_digest_size(void)
void * octave_sha512_buffer_wrapper(const char *buf, size_t len, void *res)
void * octave_md4_buffer_wrapper(const char *buf, size_t len, void *res)
int octave_sha512_digest_size(void)
int octave_md4_digest_size(void)
void * octave_md2_buffer_wrapper(const char *buf, size_t len, void *res)
void * octave_md5_buffer_wrapper(const char *buf, size_t len, void *res)
int octave_md2_digest_size(void)
void * octave_sha1_buffer_wrapper(const char *buf, size_t len, void *res)
OCTAVE_NORETURN liboctave_error_handler current_liboctave_error_handler
std::string hash(hash_fptr hash_fcn, const std::string &str, int result_buf_len)
std::string md2_hash(const std::string &str)
std::string sha256_hash(const std::string &str)
std::string sha512_hash(const std::string &str)
std::string sha384_hash(const std::string &str)
std::string sha224_hash(const std::string &str)
std::string sha1_hash(const std::string &str)
std::string md4_hash(const std::string &str)
std::string md5_hash(const std::string &str)
void *() hash_fptr(const char *buffer, std::size_t len, void *res)
#define OCTAVE_LOCAL_BUFFER(T, buf, size)