def _makepass(password, hasher='sha256'):
 if (hasher == 'sha256'):
  h = hashlib.sha256(password)
 elif (hasher == 'md5'):
  h = hashlib.md5(password)
 else:
  return NotImplemented
 c = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!?.,:;/*-+_()'
 r = {'Method': h.name, 'Salt': ''.join((random.SystemRandom().choice(c) for x in range(20)))}
 h.update(r['Salt'])
 r['Hash'] = h.hexdigest()
 return r

def _makepass ( password , hasher = 'sha256' ) : if ( hasher == 'sha256' ) : h = hashlib . sha256 ( password ) elif ( hasher == 'md5' ) : h = hashlib . md5 ( password ) else : return NotImplemented c = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!?.,:;/*-+_()' r = { 'Method' : h . name , 'Salt' : '' . join ( ( random . SystemRandom ( ) . choice ( c ) for x in range ( 20 ) ) ) } h . update ( r [ 'Salt' ] ) r [ 'Hash' ] = h . hexdigest ( ) return r
create a znc compatible hashed password .