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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file cs.serialise-20150116.tar.gz.
File metadata
- Download URL: cs.serialise-20150116.tar.gz
- Upload date:
- Size: 2.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ac71bd26f2b138abd080eedb44f8adfc5580d068739c19b934e3a0286a9fcc3d
|
|
| MD5 |
df8f81166ddec176847e021febe11f07
|
|
| BLAKE2b-256 |
ce6ca2152f7d112988d0b44216afc5bbb50330bd40359709fa7ffc729814b5d5
|