File tree Expand file tree Collapse file tree 2 files changed +2
-2
lines changed Expand file tree Collapse file tree 2 files changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -1846,7 +1846,7 @@ Bytes
1846
1846
``` python
1847
1847
< bytes > = < str > .encode(' utf-8' ) # Or: bytes(<str>, 'utf-8')
1848
1848
< bytes > = bytes (< coll_of_ints> ) # Ints must be in range from 0 to 255.
1849
- < bytes > = < int > .to_bytes(< length > , byteorder = ' big|little' , signed = False )
1849
+ < bytes > = < int > .to_bytes(n_bytes , byteorder = ' big|little' , signed = False )
1850
1850
< bytes > = bytes .fromhex(' <hex>' )
1851
1851
```
1852
1852
Original file line number Diff line number Diff line change 1643
1643
1644
1644
< div > < h3 id ="encode-1 "> Encode</ h3 > < pre > < code class ="python language-python hljs "> <bytes> = <str>.encode(< span class ="hljs-string "> 'utf-8'</ span > ) < span class ="hljs-comment "> # Or: bytes(<str>, 'utf-8')</ span >
1645
1645
<bytes> = bytes(<coll_of_ints>) < span class ="hljs-comment "> # Ints must be in range from 0 to 255.</ span >
1646
- <bytes> = <int>.to_bytes(<length> , byteorder=< span class ="hljs-string "> 'big|little'</ span > , signed=< span class ="hljs-keyword "> False</ span > )
1646
+ <bytes> = <int>.to_bytes(n_bytes , byteorder=< span class ="hljs-string "> 'big|little'</ span > , signed=< span class ="hljs-keyword "> False</ span > )
1647
1647
<bytes> = bytes.fromhex(< span class ="hljs-string "> '<hex>'</ span > )
1648
1648
</ code > </ pre > </ div >
1649
1649
You can’t perform that action at this time.
0 commit comments