From 2311b12cba83a8bdebd7bc4307345318afc6ec59 Mon Sep 17 00:00:00 2001 From: Phil <phil@secdev.org> Date: Tue, 10 Mar 2009 17:45:19 +0100 Subject: [PATCH] Added RandSByte and RandSShort --- scapy/volatile.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/scapy/volatile.py b/scapy/volatile.py index be811419..db389a30 100644 --- a/scapy/volatile.py +++ b/scapy/volatile.py @@ -115,10 +115,18 @@ class RandByte(RandSeq): def __init__(self): RandSeq.__init__(self, 0, 2L**8-1) +class RandSByte(RandSeq): + def __init__(self): + RandSeq.__init__(self, -2L**7, 2L**7-1) + class RandShort(RandSeq): def __init__(self): RandSeq.__init__(self, 0, 2L**16-1) +class RandSShort(RandSeq): + def __init__(self): + RandSeq.__init__(self, -2L**15, 2L**15-1) + class RandInt(RandSeq): def __init__(self): RandSeq.__init__(self, 0, 2L**32-1) -- GitLab