diff options
| author | Fabrice Desclaux <fabrice.desclaux@cea.fr> | 2020-07-21 15:37:39 +0200 |
|---|---|---|
| committer | Fabrice Desclaux <fabrice.desclaux@cea.fr> | 2020-07-21 16:47:59 +0200 |
| commit | 82c5d696eb97b5816a276cbf9708d0b3602d7055 (patch) | |
| tree | e90ca108dd1c130d015a3960051276d2c58d233a /miasm/core/utils.py | |
| parent | 9bf0f4c1c14d318110b56df6952b0fcc2950539e (diff) | |
| download | focaccia-miasm-82c5d696eb97b5816a276cbf9708d0b3602d7055.tar.gz focaccia-miasm-82c5d696eb97b5816a276cbf9708d0b3602d7055.zip | |
Move modint in core
Diffstat (limited to 'miasm/core/utils.py')
| -rw-r--r-- | miasm/core/utils.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/miasm/core/utils.py b/miasm/core/utils.py index 37248c40..ed630bde 100644 --- a/miasm/core/utils.py +++ b/miasm/core/utils.py @@ -129,6 +129,9 @@ def decode_hex(value): def encode_hex(value): return _ENCODE_HEX(value)[0] +def size2mask(size): + """Return the bit mask of size @size""" + return (1 << size) - 1 def hexdump(src, length=16): lines = [] |