openssl-prebuild/linux_amd64/share/doc/openssl/html/man3/OPENSSL_hexchar2int.html
2020-03-02 16:50:34 +00:00

104 lines
3.8 KiB
HTML
Executable File

<?xml version="1.0" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>OPENSSL_hexchar2int</title>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<link rev="made" href="mailto:root@localhost" />
</head>
<body style="background-color: white">
<!-- INDEX BEGIN -->
<div name="index">
<p><a name="__index__"></a></p>
<ul>
<li><a href="#name">NAME</a></li>
<li><a href="#synopsis">SYNOPSIS</a></li>
<li><a href="#description">DESCRIPTION</a></li>
<li><a href="#return_values">RETURN VALUES</a></li>
<li><a href="#copyright">COPYRIGHT</a></li>
</ul>
<hr name="index" />
</div>
<!-- INDEX END -->
<p>
</p>
<hr />
<h1><a name="name">NAME</a></h1>
<p>OPENSSL_hexchar2int,
OPENSSL_hexstr2buf_ex, OPENSSL_hexstr2buf,
OPENSSL_buf2hexstr_ex, OPENSSL_buf2hexstr
- Hex encoding and decoding functions</p>
<p>
</p>
<hr />
<h1><a name="synopsis">SYNOPSIS</a></h1>
<pre>
#include &lt;openssl/crypto.h&gt;</pre>
<pre>
int OPENSSL_hexchar2int(unsigned char c);
int OPENSSL_hexstr2buf_ex(unsigned char *buf, size_t buf_n, long *buflen,
const char *str);
unsigned char *OPENSSL_hexstr2buf(const char *str, long *len);
int OPENSSL_buf2hexstr_ex(char *str, size_t str_n, size_t *strlen,
const unsigned char *buf, long buflen);
char *OPENSSL_buf2hexstr(const unsigned char *buf, long buflen);</pre>
<p>
</p>
<hr />
<h1><a name="description">DESCRIPTION</a></h1>
<p>OPENSSL_hexchar2int() converts a hexadecimal character to its numeric
equivalent.</p>
<p>OPENSSL_hexstr2buf_ex() decodes the hex string <strong>str</strong> and places the
resulting string of bytes in the given <em>buf</em>.
<em>buf_n</em> gives the size of the buffer.
If <em>buflen</em> is not NULL, it is filled in with the result length.
To find out how large the result will be, call this function with NULL
for <em>buf</em>.
Colons between two-character hex &quot;bytes&quot; are accepted and ignored.
An odd number of hex digits is an error.</p>
<p>OPENSSL_hexstr2buf() does the same thing as OPENSSL_hexstr2buf_ex(),
but allocates the space for the result, and returns the result.
The memory is allocated by calling <code>OPENSSL_malloc()</code> and should be
released by calling <code>OPENSSL_free()</code>.</p>
<p>OPENSSL_buf2hexstr_ex() encodes the contents of the given <em>buf</em> with
length <em>buflen</em> and places the resulting hexadecimal character string
in the given <em>str</em>.
<em>str_n</em> gives the size of the of the string buffer.
If <em>strlen</em> is not NULL, it is filled in with the result length.
To find out how large the result will be, call this function with NULL
for <em>str</em>.</p>
<p>OPENSSL_buf2hexstr() does the same thing as OPENSSL_buf2hexstr_ex(),
but allocates the space for the result, and returns the result.
The memory is allocated by calling <code>OPENSSL_malloc()</code> and should be
released by calling <code>OPENSSL_free()</code>.</p>
<p>
</p>
<hr />
<h1><a name="return_values">RETURN VALUES</a></h1>
<p>OPENSSL_hexchar2int returns the value of a decoded hex character,
or -1 on error.</p>
<p>OPENSSL_buf2hexstr() and OPENSSL_hexstr2buf()
return a pointer to allocated memory, or NULL on error.</p>
<p>OPENSSL_buf2hexstr_ex() and OPENSSL_hexstr2buf_ex() return 1 on
success, or 0 on error.</p>
<p>
</p>
<hr />
<h1><a name="copyright">COPYRIGHT</a></h1>
<p>Copyright 2016-2019 The OpenSSL Project Authors. All Rights Reserved.</p>
<p>Licensed under the Apache License 2.0 (the &quot;License&quot;). You may not use
this file except in compliance with the License. You can obtain a copy
in the file LICENSE in the source distribution or at
<a href="https://www.openssl.org/source/license.html">https://www.openssl.org/source/license.html</a>.</p>
</body>
</html>