Fuzzy bit library
Project description
Fuzzybit is a library for determining possible values of bits in integers based on observed concrete values.
Install
To install fuzzybit (after downloading):
python setup.py install
To install fuzzybit with pip:
pip install fuzzybit
Using fuzzybit
Here is an example of tracking a single bit using the FuzzyBit class:
>>> import fuzzybit
>>> b = fuzzybit.FuzzyBit()
>>> b.get_value()
'?'
>>> b.observe_value('0')
>>> b.get_value()
'0'
>>> b.get_entropy()
0
>>> b.observe_value('0')
>>> b.get_value()
'0'
>>> b.get_entropy()
0
>>> b.observe_value('1')
>>> b.get_value()
'*'
>>> b.get_entropy()
1
Here is an example of tracking an integer using the FuzzyInt class:
>>> import fuzzybit >>> x = fuzzybit.FuzzyInt(16) # Create 16 bit integer >>> x.get_value() '????????????????' >>> x.observe_value(0x0ff0) >>> x.get_value() '0000111111110000' >>> x.get_entropy() 0 >>> x.observe_value(0x0000) >>> x.get_value() '0000********0000' >>> x.get_entropy() 8 >>> x.observe_value(0x0dd1) >>> x.get_value() '0000********000*' >>> x.get_entropy() 9
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
fuzzybit-0.2.0.tar.gz
(3.1 kB
view details)
File details
Details for the file fuzzybit-0.2.0.tar.gz.
File metadata
- Download URL: fuzzybit-0.2.0.tar.gz
- Upload date:
- Size: 3.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9f59405bb408f663d10ad85ff026aa82dccb02fc95a5ff4b2a43f9cc5b546019
|
|
| MD5 |
25e303a0626745c6827156bf735f46d6
|
|
| BLAKE2b-256 |
bc0f16153adaf874ebec2e1ee94e8cd75b34bc36e457639c82dd93d540bbe0f5
|