File: Base64-and-Binary-Data-Transmission.html

package info (click to toggle)
octave 10.3.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 145,388 kB
  • sloc: cpp: 335,976; ansic: 82,241; fortran: 20,963; objc: 9,402; sh: 8,756; yacc: 4,392; lex: 4,333; perl: 1,544; java: 1,366; awk: 1,259; makefile: 660; xml: 192
file content (117 lines) | stat: -rw-r--r-- 7,066 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
<!DOCTYPE html>
<html>
<!-- Created by GNU Texinfo 7.1.1, https://www.gnu.org/software/texinfo/ -->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Base64 and Binary Data Transmission (GNU Octave (version 10.3.0))</title>

<meta name="description" content="Base64 and Binary Data Transmission (GNU Octave (version 10.3.0))">
<meta name="keywords" content="Base64 and Binary Data Transmission (GNU Octave (version 10.3.0))">
<meta name="resource-type" content="document">
<meta name="distribution" content="global">
<meta name="Generator" content="makeinfo">
<meta name="viewport" content="width=device-width,initial-scale=1">

<link href="index.html" rel="start" title="Top">
<link href="Concept-Index.html" rel="index" title="Concept Index">
<link href="index.html#SEC_Contents" rel="contents" title="Table of Contents">
<link href="Networking-Utilities.html" rel="up" title="Networking Utilities">
<link href="WWW-Access.html" rel="prev" title="WWW Access">
<style type="text/css">
<!--
a.copiable-link {visibility: hidden; text-decoration: none; line-height: 0em}
span:hover a.copiable-link {visibility: visible}
strong.def-name {font-family: monospace; font-weight: bold; font-size: larger}
-->
</style>
<link rel="stylesheet" type="text/css" href="octave.css">


</head>

<body lang="en">
<div class="subsection-level-extent" id="Base64-and-Binary-Data-Transmission">
<div class="nav-panel">
<p>
Previous: <a href="WWW-Access.html" accesskey="p" rel="prev">WWW Access</a>, Up: <a href="Networking-Utilities.html" accesskey="u" rel="up">Networking Utilities</a> &nbsp; [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Concept-Index.html" title="Index" rel="index">Index</a>]</p>
</div>
<hr>
<h4 class="subsection" id="Base64-and-Binary-Data-Transmission-1"><span>36.4.3 Base64 and Binary Data Transmission<a class="copiable-link" href="#Base64-and-Binary-Data-Transmission-1"> &para;</a></span></h4>

<p>Some transmission channels can not accept binary data.  It is customary to
encode binary data in Base64 for transmission and to decode the data upon
reception.
</p>
<a class="anchor" id="XREFbase64_005fencode"></a><span style="display:block; margin-top:-4.5ex;">&nbsp;</span>


<dl class="first-deftypefn">
<dt class="deftypefn" id="index-base64_005fencode"><span><code class="def-type"><var class="var">s</var> =</code> <strong class="def-name">base64_encode</strong> <code class="def-code-arguments">(<var class="var">x</var>)</code><a class="copiable-link" href="#index-base64_005fencode"> &para;</a></span></dt>
<dd><p>Encode a double matrix or array <var class="var">x</var> into the base64 format string
<var class="var">s</var>.
</p>

<p><strong class="strong">See also:</strong> <a class="ref" href="#XREFbase64_005fdecode">base64_decode</a>, <a class="ref" href="#XREFmatlab_005fnet_005fbase64decode">matlab.net.base64decode</a>, <a class="ref" href="#XREFmatlab_005fnet_005fbase64encode">matlab.net.base64encode</a>.
</p></dd></dl>


<a class="anchor" id="XREFbase64_005fdecode"></a><span style="display:block; margin-top:-4.5ex;">&nbsp;</span>


<dl class="first-deftypefn">
<dt class="deftypefn" id="index-base64_005fdecode"><span><code class="def-type"><var class="var">x</var> =</code> <strong class="def-name">base64_decode</strong> <code class="def-code-arguments">(<var class="var">s</var>)</code><a class="copiable-link" href="#index-base64_005fdecode"> &para;</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-base64_005fdecode-1"><span><code class="def-type"><var class="var">x</var> =</code> <strong class="def-name">base64_decode</strong> <code class="def-code-arguments">(<var class="var">s</var>, <var class="var">dims</var>)</code><a class="copiable-link" href="#index-base64_005fdecode-1"> &para;</a></span></dt>
<dd><p>Decode the double matrix or array <var class="var">x</var> from the base64 encoded string
<var class="var">s</var>.
</p>
<p>The optional input parameter <var class="var">dims</var> should be a vector containing the
dimensions of the decoded array.
</p>
<p><strong class="strong">See also:</strong> <a class="ref" href="#XREFbase64_005fencode">base64_encode</a>, <a class="ref" href="#XREFmatlab_005fnet_005fbase64decode">matlab.net.base64decode</a>, <a class="ref" href="#XREFmatlab_005fnet_005fbase64encode">matlab.net.base64encode</a>.
</p></dd></dl>


<a class="anchor" id="XREFmatlab_005fnet_005fbase64encode"></a><span style="display:block; margin-top:-4.5ex;">&nbsp;</span>


<dl class="first-deftypefn">
<dt class="deftypefn" id="index-matlab_002enet_002ebase64encode"><span><code class="def-type"><var class="var">b64_str</var> =</code> <strong class="def-name">matlab.net.base64encode</strong> <code class="def-code-arguments">(<var class="var">in</var>)</code><a class="copiable-link" href="#index-matlab_002enet_002ebase64encode"> &para;</a></span></dt>
<dd>
<p>Convert <var class="var">in</var> to a base64 encoded string <var class="var">b64_str</var>.
</p>
<p>The input <var class="var">in</var> can be a string or numeric vector.
The output <var class="var">b64_str</var> will be encoded according to RFC 4648.
</p>

<p><strong class="strong">See also:</strong> <a class="ref" href="#XREFmatlab_005fnet_005fbase64decode">matlab.net.base64decode</a>, <a class="ref" href="#XREFbase64_005fdecode">base64_decode</a>, <a class="ref" href="#XREFbase64_005fencode">base64_encode</a>, <a class="ref" href="String-encoding.html#XREFunicode2native">unicode2native</a>.
</p></dd></dl>


<a class="anchor" id="XREFmatlab_005fnet_005fbase64decode"></a><span style="display:block; margin-top:-4.5ex;">&nbsp;</span>


<dl class="first-deftypefn">
<dt class="deftypefn" id="index-matlab_002enet_002ebase64decode"><span><code class="def-type"><var class="var">out_vec</var> =</code> <strong class="def-name">matlab.net.base64decode</strong> <code class="def-code-arguments">(<var class="var">b64_str</var>)</code><a class="copiable-link" href="#index-matlab_002enet_002ebase64decode"> &para;</a></span></dt>
<dd>
<p>Convert base64 encoded <var class="var">b64_str</var> to uint8 vector <var class="var">out_vec</var>.
</p>
<p>The input <var class="var">b64_str</var> must be a string vector.
The output <var class="var">out_vec</var> will be a uint8 vector that is decoded
according to RFC 4648.
</p>

<p><strong class="strong">See also:</strong> <a class="ref" href="#XREFmatlab_005fnet_005fbase64encode">matlab.net.base64encode</a>, <a class="ref" href="#XREFbase64_005fdecode">base64_decode</a>, <a class="ref" href="#XREFbase64_005fencode">base64_encode</a>, <a class="ref" href="String-encoding.html#XREFnative2unicode">native2unicode</a>.
</p></dd></dl>


</div>
<hr>
<div class="nav-panel">
<p>
Previous: <a href="WWW-Access.html">WWW Access</a>, Up: <a href="Networking-Utilities.html">Networking Utilities</a> &nbsp; [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Concept-Index.html" title="Index" rel="index">Index</a>]</p>
</div>



</body>
</html>