eric7.WebBrowser.SafeBrowsing.SafeBrowsingUrl

Module implementing an URL representation suitable for Google Safe Browsing.

Global Attributes

None

Classes

SafeBrowsingUrl Class implementing an URL representation suitable for Google Safe Browsing.

Functions

None


SafeBrowsingUrl

Class implementing an URL representation suitable for Google Safe Browsing.

Derived from

None

Class Attributes

None

Class Methods

None

Methods

SafeBrowsingUrl Constructor
canonical Public method to convert the URL to the canonical form.
fullUnescape Method to recursively unescape an URL.
hashes Public method to get the hashes of all possible permutations of the URL in canonical form.
hostPermutations Method to generate the permutations of the host name.
pathPermutations Method to generate the permutations of the path.
quote Method to quote a string.

Static Methods

digest Static method to calculate the SHA256 digest of an URL string.
permutations Static method to determine all permutations of host name and path which can be applied to blocked URLs.

SafeBrowsingUrl (Constructor)

SafeBrowsingUrl(url)

Constructor

url (str)
URL to be embedded

SafeBrowsingUrl.canonical

canonical()

Public method to convert the URL to the canonical form.

Return:
canonical form of the URL
Return Type:
str

SafeBrowsingUrl.fullUnescape

fullUnescape()

Method to recursively unescape an URL.

u (str)
URL string to unescape
Return:
unescaped URL string
Return Type:
str

SafeBrowsingUrl.hashes

hashes()

Public method to get the hashes of all possible permutations of the URL in canonical form.

Yield:
URL hashes
Yield Type:
bytes

SafeBrowsingUrl.hostPermutations

hostPermutations()

Method to generate the permutations of the host name.

host (str)
host name
Yield:
permutated host names
Yield Type:
str

SafeBrowsingUrl.pathPermutations

pathPermutations()

Method to generate the permutations of the path.

path (str)
path to be processed
Yield:
permutated paths
Yield Type:
str

SafeBrowsingUrl.quote

quote()

Method to quote a string.

string (str)
to be quoted
Return:
quoted string
Return Type:
str

SafeBrowsingUrl.digest (static)

digest()

Static method to calculate the SHA256 digest of an URL string.

url (str)
URL string
Return:
SHA256 digest of the URL string
Return Type:
bytes

SafeBrowsingUrl.permutations (static)

permutations()

Static method to determine all permutations of host name and path which can be applied to blocked URLs.

url (str)
URL string to be permuted
Yield:
permutated URL strings
Yield Type:
str
Up