コード例 #1
0
ファイル: __init__.py プロジェクト: studiomezklador/faker
 def sha1(cls, raw_output=False):
     """
     Calculates the sha1 hash of a given string
     :example 'b5d86317c2a144cd04d0d7c03b2b02666fafadf2'
     """
     res = hashlib.sha1(str(random.random()).encode('utf-8'))
     if raw_output:
         return res.digest()
     return res.hexdigest()
コード例 #2
0
ファイル: __init__.py プロジェクト: studiomezklador/faker
 def sha256(cls, raw_output=False):
     """
     Calculates the sha256 hash of a given string
     :example '85086017559ccc40638fcde2fecaf295e0de7ca51b7517b6aebeaaf75b4d4654'
     """
     res = hashlib.sha256(str(random.random()).encode('utf-8'))
     if raw_output:
         return res.digest()
     return res.hexdigest()
コード例 #3
0
ファイル: __init__.py プロジェクト: studiomezklador/faker
 def md5(cls, raw_output=False):
     """
     Calculates the md5 hash of a given string
     :example 'cfcd208495d565ef66e7dff9f98764da'
     """
     res = hashlib.md5(str(random.random()).encode('utf-8'))
     if raw_output:
         return res.digest()
     return res.hexdigest()
コード例 #4
0
ファイル: __init__.py プロジェクト: 4sp1r3/faker
 def sha256(cls, raw_output=False):
     """
     Calculates the sha256 hash of a given string
     :example '85086017559ccc40638fcde2fecaf295e0de7ca51b7517b6aebeaaf75b4d4654'
     """
     res = hashlib.sha256(str(random.random()).encode('utf-8'))
     if raw_output:
         return res.digest()
     return res.hexdigest()
コード例 #5
0
ファイル: __init__.py プロジェクト: 4sp1r3/faker
 def sha1(cls, raw_output=False):
     """
     Calculates the sha1 hash of a given string
     :example 'b5d86317c2a144cd04d0d7c03b2b02666fafadf2'
     """
     res = hashlib.sha1(str(random.random()).encode('utf-8'))
     if raw_output:
         return res.digest()
     return res.hexdigest()
コード例 #6
0
ファイル: __init__.py プロジェクト: 4sp1r3/faker
 def md5(cls, raw_output=False):
     """
     Calculates the md5 hash of a given string
     :example 'cfcd208495d565ef66e7dff9f98764da'
     """
     res = hashlib.md5(str(random.random()).encode('utf-8'))
     if raw_output:
         return res.digest()
     return res.hexdigest()
コード例 #7
0
 def timestamp(self):
     return fake.unix_time() + round(random.random(), 6)