HCE Project Python language Distributed Tasks Manager Application, Distributed Crawler Application and client API bindings.  2.0.0-chaika
Hierarchical Cluster Engine Python language binding
scraper_utils.py
Go to the documentation of this file.
1 """@package docstring
2  @file scraper_utils.py
3  @author Alexey <developers.hce@gmail.com>
4  @link http://hierarchical-cluster-engine.com/
5  @copyright Copyright &copy; 2013 IOIX Ukraine
6  @license http://hierarchical-cluster-engine.com/license/
7  @package HCE project node API
8  @since 0.1
9 """
10 
11 
12 import base64
13 import md5
14 
15 
16 # convert plain text to base64 encoded string
17 def encode(text):
18  return base64.b64encode(text)
19 # convert base64 encoded string to plain text
20 def decode(text):
21  return base64.b64decode(text)
22 
23 
24 def unicode_decode(text):
25  return str(text).decode("utf-8")
26 
27 
28 def md5_encode(text):
29  return str(md5.new(unicode_decode(text)).hexdigest())