WebBrowser/SafeBrowsing/SafeBrowsingUtilities.py

Wed, 26 Jul 2017 19:46:17 +0200

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Wed, 26 Jul 2017 19:46:17 +0200
branch
safe_browsing
changeset 5819
69fa45e95673
child 6048
82ad8ec9548c
permissions
-rw-r--r--

Finished implementing the SafeBrowsingCache class.

# -*- coding: utf-8 -*-

# Copyright (c) 2017 Detlev Offenbach <detlev@die-offenbachs.de>
#

"""
Module implementing some utilities for Google Safe Browsing.
"""

from __future__ import unicode_literals

import sys

if sys.version_info < (3, 0):
    def toHex(value):
        """
        Public method to convert a bytes array to a hex string.
        
        @param value value to be converted
        @type bytes
        @return hex string
        @rtype str
        """
        return value.encode("hex")
else:
    def toHex(value):
        """
        Public method to convert a bytes array to a hex string.
        
        @param value value to be converted
        @type bytes
        @return hex string
        @rtype str
        """
        return value.hex()

eric ide

mercurial