问题
Why doesn't the .NET Base Class Libary have CRC classes?
回答1:
Eric Lippert has the best explanation of "Why Feature X is not implemented" (I think he knows a thing or two about why or why not things get implemented in the language)
I am asked "why doesn't C# implement feature X?" all the time. The answer is always the same: because no one ever designed, specified, implemented, tested, documented and shipped that feature. All six of those things are necessary to make a feature happen. All of them cost huge amounts of time, effort and money. Features are not cheap, and we try very hard to make sure that we are only shipping those features which give the best possible benefits to our users given our constrained time, effort and money budgets.
From here (unreleated topic but relevant answer): http://web.archive.org/web/20140414043740/http://blogs.msdn.com/b/ericlippert/archive/2009/06/22/why-doesn-t-c-implement-top-level-methods.aspx
回答2:
There are well-established algorithms for these (and CRC are also relatively simple to implement compared to encryption) and many open implementations to choose from.
http://tomkaminski.com/crc32-hashalgorithm-c-net
来源:https://stackoverflow.com/questions/5588795/why-doesnt-the-bcl-have-crc-classes