truncate SHA if needed