Generate SHA1 Hash in Portable Class Library

前端 未结 9 2054
爱一瞬间的悲伤
爱一瞬间的悲伤 2021-01-07 23:56

I\'m trying to build a portable class library that generates OAuth urls for other classes/applications to use. This class library using OAuth has to be a portable class libr

9条回答
  •  不知归路
    2021-01-08 00:54

    Well I needed this too recently and I found much easier to take SHA1 implementation from HashLib : http://hashlib.codeplex.com/

    Mono implementation have some far-going dependencies (localization of exceptions, etc.), while from HashLib you need only to copy few files without any changes in them:

    Converters.cs
    Hash.cs
    HashBuffer.cs
    HashCryptoNotBuildIn.cs
    HashResult.cs
    IHash.cs
    SHA0.cs
    SHA1.cs
    

    55 KB of code total, so nothing too heavy.

提交回复
热议问题