gufo.blob.utils¶
Various utilities.
bytes_to_int(x)
¶
Convert string representation to integer value.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
x
|
bytes
|
string representation |
required |
Returns:
| Type | Description |
|---|---|
int
|
Converted integer. |
Raises:
| Type | Description |
|---|---|
BlobError
|
on invalid value |
bytes_to_int_range(x, min_value=None, max_value=None)
¶
Convert string representation to integer in range.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
x
|
bytes
|
string representation. |
required |
min_value
|
int | None
|
Optional minimum value. |
None
|
max_value
|
int | None
|
Optional max value. |
None
|
Returns:
| Type | Description |
|---|---|
int
|
converted integer. |
Raises:
| Type | Description |
|---|---|
BlobError
|
on error. |