Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/ikvm-fork.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'reflect/AssemblyName.cs')
-rw-r--r--reflect/AssemblyName.cs13
1 files changed, 8 insertions, 5 deletions
diff --git a/reflect/AssemblyName.cs b/reflect/AssemblyName.cs
index 43c25e8d..ce2a96b7 100644
--- a/reflect/AssemblyName.cs
+++ b/reflect/AssemblyName.cs
@@ -402,13 +402,16 @@ namespace IKVM.Reflection
{
return publicKey;
}
- byte[] hash = new SHA1Managed().ComputeHash(publicKey);
- byte[] token = new byte[8];
- for (int i = 0; i < token.Length; i++)
+ using (var sha1 = SHA1.Create())
{
- token[i] = hash[hash.Length - 1 - i];
+ byte[] hash = sha1.ComputeHash(publicKey);
+ byte[] token = new byte[8];
+ for (int i = 0; i < token.Length; i++)
+ {
+ token[i] = hash[hash.Length - 1 - i];
+ }
+ return token;
}
- return token;
}
internal static string ComputePublicKeyToken(string publicKey)