Spatial encoding algorithm using psuedo hilbert curves
Project description
Spatial Codec
Modified: 2021-06
Navigation
About
Spatial codec is a spatial encoding and decoding algorithm developed for iteratively mapping any number of bytes to a 3D (N3 space) matrix. The algorithm uses a psuedo variant of Hilbert's Space Filling Curve which preserves the relative localization of bits in 3D independant of the matrix dimension which is a convienient property for error correction and scalable network policies.
Quickstart
Install python dependancies
python3 -m pip install -r requirements.txt
...
Run the algorithm for a specified block size -b
/ --block
, with a data stream -d
/ --data
and dimension -n
/ --dimension
(2 or 3). The MPL visualizer can be enabled with the -v=
flag.
# n2 codec invocation
python3 -m codec -n 2 -b 512 -d "Hello World" -v=
...
# n3 codec invocation
python3 -m codec -n 3 -b 8 -d "H" -v=
Dev
Setup on M1 macs requires some additional configuration. I have automated the installation:
./scripts/m1-setup.sh
License
BSD 2-Clause License available here
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.