From d21fd182823092e070bb6d567c45e179a99c83c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jure=20=C5=A0orn?= Date: Mon, 19 Nov 2018 22:55:12 +0100 Subject: [PATCH] Bytes and Struct --- README.md | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 1ebd2ac..58ea684 100644 --- a/README.md +++ b/README.md @@ -639,21 +639,17 @@ Bytes ----- **Bytes objects are immutable sequences of single bytes.** -#### Str: +### Encode ```python = b'' - = .decode('utf-8') -``` - -#### Int: -```python = .to_bytes(, byteorder='big|small', signed=False) - = int.from_bytes(, byteorder='big|small', signed=False) + = bytes.fromhex() ``` -#### Hex: +### Decode ```python - = bytes.fromhex() + = .decode('utf-8') + = int.from_bytes(, byteorder='big|small', signed=False) = .hex() ```