Shad Storhaug created LUCENENET-637:
---------------------------------------

             Summary: Factor out ICheckSum and replace with 
System.Security.Cryptography.HashAlgorithm
                 Key: LUCENENET-637
                 URL: https://issues.apache.org/jira/browse/LUCENENET-637
             Project: Lucene.Net
          Issue Type: Task
          Components: Lucene.Net Core
    Affects Versions: Lucene.Net 4.8.0
            Reporter: Shad Storhaug


{{IChecksum}} was brought over from Java in order to plug in the {{CRC32}} 
class.

However, .NET already has its own abstract class, 
[HashAlgorithm|https://docs.microsoft.com/en-us/dotnet/api/system.security.cryptography.hashalgorithm]
 that is used to as a base class for all cryptographic algorithms. There are 
also several 3rd party implementations of CRC32 that implement 
{{HashAlgorithm}} that we could use (provided we drop support for .NET 
framework < 4.6.1). [Crc32.NET|https://www.nuget.org/packages/Crc32.NET/] 
claims to be one of the fastest implementations.

{{IChecksum}} is only utilized in a couple of places, but Lucene.NET's types 
should also be renamed accordingly to show they are using {{HashAlgorigthm}} 
instead of {{IChecksum}}:

* {{BufferedChecksum}} > {{BufferedHashAlgorithm}}
* {{BufferedChecksumIndexInput}} > {{BufferedHashAlgorithmIndexInput}}

The APIs between {{IChecksum}} and {{HashAlgorithm}} differ, but being that 
they serve the exact same purpose we should be able to make this work with a 
bit of refactoring.




--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to