From 75e960c525c5587b717c9840bbacececd0ff5286 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jure=20=C5=A0orn?= Date: Thu, 20 Jun 2024 03:17:12 +0200 Subject: [PATCH] Bytes --- README.md | 4 ++-- index.html | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index f3077ae..761f09f 100644 --- a/README.md +++ b/README.md @@ -1963,7 +1963,7 @@ Bytes ### Encode ```python = bytes() # Ints must be in range from 0 to 255. - = bytes(, 'utf-8') # Encodes string. Also .encode('utf-8'). + = bytes(, 'utf-8') # Encodes the string. Also .encode(). = bytes.fromhex('') # Hex pairs can be separated by whitespaces. = .to_bytes(n_bytes, …) # `byteorder='big/little', signed=False`. ``` @@ -1971,7 +1971,7 @@ Bytes ### Decode ```python = list() # Returns ints in range from 0 to 255. - = str(, 'utf-8') # Decodes bytes. Also .decode('utf-8'). + = str(, 'utf-8') # Returns a string. Also .decode(). = .hex() # Returns hex pairs. Accepts `sep=`. = int.from_bytes(, …) # `byteorder='big/little', signed=False`. ``` diff --git a/index.html b/index.html index 912273e..126c6cf 100644 --- a/index.html +++ b/index.html @@ -1623,13 +1623,13 @@ CompletedProcess(args=['bc', Encode
<bytes> = bytes(<coll_of_ints>)          # Ints must be in range from 0 to 255.
-<bytes> = bytes(<str>, 'utf-8')          # Encodes string. Also <str>.encode('utf-8').
+<bytes> = bytes(<str>, 'utf-8')          # Encodes the string. Also <str>.encode().
 <bytes> = bytes.fromhex('<hex>')         # Hex pairs can be separated by whitespaces.
 <bytes> = <int>.to_bytes(n_bytes, …)     # `byteorder='big/little', signed=False`.
 

Decode

<list>  = list(<bytes>)                  # Returns ints in range from 0 to 255.
-<str>   = str(<bytes>, 'utf-8')          # Decodes bytes. Also <bytes>.decode('utf-8').
+<str>   = str(<bytes>, 'utf-8')          # Returns a string. Also <bytes>.decode().
 <str>   = <bytes>.hex()                  # Returns hex pairs. Accepts `sep=<str>`.
 <int>   = int.from_bytes(<bytes>, …)     # `byteorder='big/little', signed=False`.