Skip to main content

some serialisation functions

Project description

I use these functions to serialise and de-serialise non-negative integers of arbitrary size and run length encoded block data.

The integers are encoded as octets in big-endian order, with the high bit indicating that more octets follow.

  • get_bs(bs, offset=0): collect an integer from the bytes bs at the specified offset

  • get_bsdata(bs, offset=0): collect a run length encoded data block from the bytes bs at the specified offset

  • get_bsfp(fp): collect an integer from the binary file fp

  • put_bs(n): return the bytes encoding of the supplied integer n

  • put_bsdata(data): return the bytes run length encoding of the supplied data block

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

cs.serialise-20160828.tar.gz (3.7 kB view details)

Uploaded Source

File details

Details for the file cs.serialise-20160828.tar.gz.

File metadata

File hashes

Hashes for cs.serialise-20160828.tar.gz
Algorithm Hash digest
SHA256 31788d9011221af2e7d1cb93d6a39f08543f506a9ab92e9c7eb626ddcc6a11cd
MD5 97c0a8d1b2f1f34fd9907f1b63dff45e
BLAKE2b-256 a04612d6acd2b7c266432155408b69263f0da244b726c39765a5c68f474fbd98

See more details on using hashes here.

Supported by

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