JSONSerializer
Simple wrapper around json to be used in signing.dumps and signing.loads.
Methods
dumps()
@classmethod
def dumps(
obj: object
) - > bytes
Serializes a Python object into a compact JSON byte string encoded in latin-1.
Parameters
| Name | Type | Description |
|---|---|---|
| obj | object | The Python object to be serialized into a JSON format. |
Returns
| Type | Description |
|---|---|
bytes | A latin-1 encoded byte string containing the JSON representation of the object with no whitespace separators. |
loads()
@classmethod
def loads(
data: bytes
) - > object
Deserializes a latin-1 encoded byte string containing JSON data back into a Python object.
Parameters
| Name | Type | Description |
|---|---|---|
| data | bytes | The latin-1 encoded byte string containing the JSON data to be parsed. |
Returns
| Type | Description |
|---|---|
object | The Python object representation of the decoded JSON data. |