A future change will use this when available to avoid sha1 collision
issues until we can get moved to something else.
Details
- Reviewers
indygreg - Group Reviewers
hg-reviewers - Commits
- rHGbde1cd4c99d9: sha1dc: initial implementation of Python extension
Diff Detail
- Repository
- rHG Mercurial
- Branch
- default
- Lint
No Linters Available - Unit
No Unit Test Coverage
Event Timeline
mercurial/thirdparty/sha1dc/cext.c | ||
---|---|---|
25 | Nit: "clang-format on" (typo: s/oon/on/) | |
105 | I think you need a {NULL} entry here, or else it's going to walk off the end of this array when creating the type. | |
149 | You may also need a NULL entry here, haven't tracked down where this is used. | |
153 | why do this here instead of above? |
This seems mostly good to me.
mercurial/thirdparty/sha1dc/cext.c | ||
---|---|---|
68 | I'm not super keen on overloading OverflowError here. Or is this how hashlib works in the Python standard library? | |
92 | I didn't verify this is correct because I didn't want to think too hard. Test coverage for parity with hashlib would be appreciated. | |
107 | Should this be a memcpy or some such? Or is this opaque type safe to copy by value? Test coverage for this demonstrating that a seeded hasher which is copied can properly diverge would be appreciated. | |
172 | Nit: please always use braces. |
Good call on tests, I had the return type of hexdigest() wrong. Please do let me know if you think of any missing cases here.
mercurial/thirdparty/sha1dc/cext.c | ||
---|---|---|
68 | This is new functionality compared to hashlib (this is the "zomg someone is breaking ur sha1" error case), so there's not anything comparable. I didn't really want to go to the effort of defining our own custom exception type for a case we should never see in the wild. | |
107 | I verified by inspection (when writing this) that copying by value is okay here (no pointers, etc), and we now have test coverage that will catch any regression here. |
Nit: "clang-format on" (typo: s/oon/on/)