def generate_hash(txt=None, length=None):
 import hashlib, time
 from .utils import random_string
 digest = hashlib.sha224((((txt or u'') + repr(time.time())) + repr(random_string(8)))).hexdigest()
 if length:
  digest = digest[:length]
 return digest

def generate_hash ( txt = None , length = None ) : import hashlib , time from . utils import random_string digest = hashlib . sha224 ( ( ( ( txt or u'' ) + repr ( time . time ( ) ) ) + repr ( random_string ( 8 ) ) ) ) . hexdigest ( ) if length : digest = digest [ : length ] return digest
generates random hash for given text + current timestamp + random string .