def obj_sha(type, chunks):
 sha = sha1()
 sha.update(object_header(type, chunks_length(chunks)))
 if isinstance(chunks, bytes):
  sha.update(chunks)
 else:
  for chunk in chunks:
   sha.update(chunk)
 return sha.digest()

def obj_sha ( type , chunks ) : sha = sha1 ( ) sha . update ( object_header ( type , chunks_length ( chunks ) ) ) if isinstance ( chunks , bytes ) : sha . update ( chunks ) else : for chunk in chunks : sha . update ( chunk ) return sha . digest ( )
compute the sha for a numeric type and object chunks .