From b4ea03b447e075ecfeefa1b22d0a0497ad80c0eb Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Thu, 12 Sep 2019 17:03:31 +0800 Subject: [PATCH] 1 --- q7/sysutils.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/q7/sysutils.py b/q7/sysutils.py index 1233ebb..187e41e 100644 --- a/q7/sysutils.py +++ b/q7/sysutils.py @@ -1,6 +1,8 @@ # -*- coding: utf-8 -*- #!/usr/bin/python +import binascii + def xPrint(text): print(text, flush=True) @@ -8,3 +10,7 @@ def getDaySeconds(time_val, incdays): time_zone = 8 return int((time_val + time_zone * 3600)/3600/24 + incdays) * 3600 * 24 - 3600 * time_zone; +def crc32(data): + hash_code = binascii.crc32(data) + assert hash_code >= 0 + return hash_code