Skip to main content

Spatial encoding algorithm using psuedo hilbert curves

Project description

Spatial Codec

ci

Modified: 2021-06

Navigation

  1. About
  2. Quickstart
  3. Dev
  4. License

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.

Source Distribution

scodec-0.0.1.tar.gz (10.0 kB view hashes)

Uploaded Source

Built Distribution

scodec-0.0.1-py3-none-any.whl (11.5 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page