code: def content_sha1(context):
      
      try:
          content = context.current_parameters['content']
      except AttributeError:
          content = context
      return hashlib.sha1(encodeutils.to_utf8(content)).hexdigest()
docs: Used by the FileContent model to automatically compute the sha1
      hash of content before storing it to the database.