mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2026-01-04 21:59:03 +00:00
Minor optimization in HashDB
This commit is contained in:
@@ -8,6 +8,7 @@ See the file 'LICENSE' for copying permission
|
||||
import hashlib
|
||||
import os
|
||||
import sqlite3
|
||||
import struct
|
||||
import threading
|
||||
import time
|
||||
|
||||
@@ -81,7 +82,7 @@ class HashDB(object):
|
||||
@staticmethod
|
||||
def hashKey(key):
|
||||
key = getBytes(key if isinstance(key, six.text_type) else repr(key), errors="xmlcharrefreplace")
|
||||
retVal = int(hashlib.md5(key).hexdigest(), 16) & 0x7fffffffffffffff # Reference: http://stackoverflow.com/a/4448400
|
||||
retVal = struct.unpack("<Q", hashlib.md5(key).digest()[:8])[0] & 0x7fffffffffffffff
|
||||
return retVal
|
||||
|
||||
def retrieve(self, key, unserialize=False):
|
||||
|
||||
Reference in New Issue
Block a user