summaryrefslogtreecommitdiffstats
path: root/glucometerutils/drivers/lifescan_common.py
diff options
context:
space:
mode:
authorDiego Elio Pettenò <flameeyes@flameeyes.eu>2014-01-29 23:45:05 +0100
committerDiego Elio Pettenò <flameeyes@flameeyes.eu>2014-01-29 23:45:05 +0100
commit6bfc12f901e938f95ea64bd0a80090333769e234 (patch)
tree0a2e9cf8df42efd1e93d0430431000a5cfb93dfa /glucometerutils/drivers/lifescan_common.py
parentInitial support for OneTouch Ultra Easy glucometers. (diff)
downloadglucometerutils-6bfc12f901e938f95ea64bd0a80090333769e234.tar
glucometerutils-6bfc12f901e938f95ea64bd0a80090333769e234.tar.gz
glucometerutils-6bfc12f901e938f95ea64bd0a80090333769e234.tar.bz2
glucometerutils-6bfc12f901e938f95ea64bd0a80090333769e234.tar.lz
glucometerutils-6bfc12f901e938f95ea64bd0a80090333769e234.tar.xz
glucometerutils-6bfc12f901e938f95ea64bd0a80090333769e234.tar.zst
glucometerutils-6bfc12f901e938f95ea64bd0a80090333769e234.zip
Diffstat (limited to 'glucometerutils/drivers/lifescan_common.py')
-rw-r--r--glucometerutils/drivers/lifescan_common.py20
1 files changed, 0 insertions, 20 deletions
diff --git a/glucometerutils/drivers/lifescan_common.py b/glucometerutils/drivers/lifescan_common.py
index ada58e8..9a60ab6 100644
--- a/glucometerutils/drivers/lifescan_common.py
+++ b/glucometerutils/drivers/lifescan_common.py
@@ -26,23 +26,3 @@ class InvalidSerialNumber(exceptions.Error):
"""The serial number is not as expected."""
def __init__(self, serial_number):
self.message = 'Serial number %s is invalid.' % serial_number
-
-
-def calculate_checksum(bytestring):
- """Calculate the checksum used by OneTouch Ultra and Ultra2 devices
-
- Args:
- bytestring: the string of which the checksum has to be calculated.
-
- Returns:
- A string with the hexdecimal representation of the checksum for the input.
-
- The checksum is a very stupid one: it just sums all the bytes,
- modulo 16-bit, without any parity.
- """
- checksum = 0
-
- for byte in bytestring:
- checksum = (checksum + byte) & 0xffff
-
- return checksum