|
|
@ -1242,7 +1242,7 @@ db.commit() |
|
|
|
<h3 id="decode-1">Decode</h3> |
|
|
|
<pre><code class="python language-python hljs"><str> = <bytes>.decode(encoding=<span class="hljs-string">'utf-8'</span>) |
|
|
|
<int> = int.from_bytes(<bytes>, byteorder=<span class="hljs-string">'big|little'</span>, signed=<span class="hljs-keyword">False</span>) |
|
|
|
<hex> = <bytes>.hex() |
|
|
|
<span class="hljs-string">'<hex>'</span> = <bytes>.hex() |
|
|
|
</code></pre> |
|
|
|
<h3 id="readbytesfromfile">Read Bytes from File</h3> |
|
|
|
<pre><code class="python language-python hljs"><span class="hljs-function"><span class="hljs-keyword">def</span> <span class="hljs-title">read_bytes</span><span class="hljs-params">(filename)</span>:</span> |
|
|
|
xxxxxxxxxx