Skip to content

Commit

Permalink
Merge pull request #4 from ionite34/dev
Browse files Browse the repository at this point in the history
  • Loading branch information
ionite34 authored Sep 17, 2022
2 parents 12fe0a5 + c453f16 commit 03c1dd0
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 2 deletions.
3 changes: 2 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
[package]
name = "base2048"
version = "0.1.0"
description = "Binary encoding with Base2048 in Rust."
version = "0.1.1"
edition = "2021"
exclude = ["/dist"]

Expand Down
17 changes: 17 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,23 @@ unpacked[2000:2002]
>> '🦀🐍'
```

### Decode errors are provided with a character-position of failure

```python
----> base2048.decode('༗ǥԢΝĒϧǰ༎ǥ')

DecodeError: Unexpected character 8: ['ǥ'] after termination sequence 7: ['']
```
- To catch the error, use either `base2048.DecodeError` or its base exception, `ValueError`.
```python
from base2048 import DecodeError

try:
base2048.decode('🤔')
except DecodeError as e:
print(e)
```

## License
The code in this project is released under the [MIT License](LICENSE).

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "base2048"
version = "0.1.0"
version = "0.1.1"
readme = "README.md"
requires-python = ">=3.7"
license = { text = "MIT" }
Expand Down

0 comments on commit 03c1dd0

Please sign in to comment.