Revision 33081d90 lib/utils.py

b/lib/utils.py
864 864
    f.close()
865 865

  
866 866

  
867
def GenerateSecret():
868
  """Generates a random secret.
869

  
870
  This will generate a pseudo-random secret, and return its sha digest
871
  (so that it can be used where an ASCII string is needed).
872

  
873
  """
874
  return sha.new(os.urandom(64)).hexdigest()
875

  
876

  
867 877
def ReadFile(file_name, size=None):
868 878
  """Reads a file.
869 879

  

Also available in: Unified diff