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-20150116.tar.gz (2.4 kB view details)

Uploaded Source

File details

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

File metadata

File hashes

Hashes for cs.serialise-20150116.tar.gz
Algorithm Hash digest
SHA256 ac71bd26f2b138abd080eedb44f8adfc5580d068739c19b934e3a0286a9fcc3d
MD5 df8f81166ddec176847e021febe11f07
BLAKE2b-256 ce6ca2152f7d112988d0b44216afc5bbb50330bd40359709fa7ffc729814b5d5

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