Refactored calcSha1(List<DetailAst>).