# eric6.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

object

### 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 blacklisted 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.

Returns:
  canonical form of the URL

Return Type:
  str

#### SafeBrowsingUrl.fullUnescape

fullUnescape()

Method to recursively unescape an URL.

u (str)
  URL string to unescape

Returns:
  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.

Returns:
  generator for the URL hashes

Return Type:
  generator of bytes

#### SafeBrowsingUrl.hostPermutations

hostPermutations()

Method to generate the permutations of the host name.

host (str)
  host name

Returns:
  generator of permuted host names

Return Type:
  generator of str

#### SafeBrowsingUrl.pathPermutations

pathPermutations()

Method to generate the permutations of the path.

path (str)
  path to be processed

Returns:
  generator of permuted paths

Return Type:
  generator of str

#### SafeBrowsingUrl.quote

quote()

Method to quote a string.

string (str)
  to be quoted

Returns:
  quoted string

Return Type:
  str

#### SafeBrowsingUrl.digest (static)

digest()

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

url (str)
  URL string

Returns:
  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 blacklisted URLs.

url (str)
  URL string to be permuted

Returns:
  generator of permuted URL strings

Return Type:
  generator of str

Up