Metadata-Version: 2.4
Name: nix-base32
Version: 0.4.2
Summary: Pure Python implementation of nix variant of base32
Author-email: "Peter A." <ink.splatters@pm.me>
License: MIT License
        
        Copyright (c) 2025 Peter A.
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
License-File: LICENSE
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3.14
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Programming Language :: Python :: Implementation :: PyPy
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.14
Provides-Extra: cli
Requires-Dist: click>=8.3.0; extra == 'cli'
Description-Content-Type: text/markdown

# nix‑base32

Pure‑Python implementation of the Nix‑specific base32 variant.

______________________________________________________________________

## Installation

```bash
uv tool install 'nix-base32[cli] @ git+https://github.com/ink-splatters/nix-base32'
```

______________________________________________________________________

## Usage

### Python

```python
from base32 import encode, decode

data = b"hello"
encoded = encode(data)
print(encoded)           # -> NixBase32Str('nbswy3dp')
print(decode(encoded))   # -> b'hello'
```

### CLI

the CLI was inspired by BSD bintrans' `base64` util (now part of standard macOS distribution).

_Examples:_

```bash
❯ echo de2fc4ce5252da49a272fb22e68c73dcfa12ef08077ac26b40ad3a40dd31376e | base32
0vip67fl0fmd81mw4yh713pi5ynwff6fc8pvfai4knjjab7c8byy

❯ echo 0vip67fl0fmd81mw4yh713pi5ynwff6fc8pvfai4knjjab7c8byy | base32 --sri
sha256-3i/EzlJS2kmicvsi5oxz3PoS7wgHesJrQK06QN0xN24=

❯ echo de2fc4ce5252da49a272fb22e68c73dcfa12ef08077ac26b40ad3a40dd31376e | base32 | base32 -d
de2fc4ce5252da49a272fb22e68c73dcfa12ef08077ac26b40ad3a40dd31376e
```

______________________________________________________________________

## License

MIT — see [LICENSE](LICENSE).

## Contributions

Contributions are welcome at the author's discretion; please open an issue first.
See any standard open collaborative code of conduct such as
[Contributor Covenant](https://www.contributor-covenant.org/).
