nancryption
nancryption encodes float32 values into float64 quiet-NaN bit patterns and decodes them back again. This is useful when you need to smuggle a 32-bit payload through a float64-only path while still tagging values as NaN.
Install
uv sync
Quick Start
import numpy as np
from nancryption import nancrypt, nandecrypt
payload = np.array([1.0, -2.5, np.pi], dtype=np.float32)
encoded = nancrypt(payload)
decoded = nandecrypt(encoded)
print(encoded.dtype) # float64
print(np.isnan(encoded).all()) # True
print(np.array_equal(decoded, payload)) # True
API
nancrypt(a: np.ndarray) -> np.ndarrayEncodes float32 payload bits into float64 quiet NaN values.nandecrypt(arr: np.ndarray) -> np.ndarrayRecovers the embedded float32 payload from encoded float64 values.
Development
Run tests:
uv run pytest
Metadata
Release files for nancryption 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| nancryption-0.1.0.tar.gz | 46.3 kB | Without provenance | Details for nancryption-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| nancryption-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for nancryption-0.1.0-py3-none-any.whl |
Total release size: 49.0 kB
Release files / nancryption-0.1.0.tar.gz
| Download URL | nancryption-0.1.0.tar.gz |
|---|---|
| Size | 46.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
8b7a231f47123c99b8ddaceb9e043f53532a4d5bebce671d69f3cd3a0bbcf44d
|
|
BLAKE2b-256 checksum How to use checksums |
39fb02c7bdf19833a0a19d56734db364a53162916d213c3f71ebd0c0e0588208
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.6.2
|
Release files / nancryption-0.1.0-py3-none-any.whl
| Download URL | nancryption-0.1.0-py3-none-any.whl |
|---|---|
| Size | 2.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
b6392124bf85c7a86c7e6c3c2aa5e9b70eef1fc31a840bef7ef4d9e6f9d82b3e
|
|
BLAKE2b-256 checksum How to use checksums |
282ead2c96180f85209a488afe5891fa8148b8794da6644f0202bc298101635c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.6.2
|
Security for nancryption 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.