Skip to content

Commit

Permalink
Changed Namespace and Class names
Browse files Browse the repository at this point in the history
  • Loading branch information
n3wt0n committed Sep 11, 2015
1 parent b258f77 commit dfa088e
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 13 deletions.
@@ -1,12 +1,12 @@
using System;

namespace DBTek.Crypto.Hashers
namespace DBTek.Crypto.Algorithms
{
internal class CRC32 : IDisposable
internal class CRC32Impl : IDisposable
{
uint[] table;

public CRC32()
public CRC32Impl()
{
uint poly = 0xedb88320;
table = new uint[256];
Expand Down
@@ -1,7 +1,7 @@
using System;
using System.Text;

namespace DBTek.Crypto.Hashers
namespace DBTek.Crypto.Algorithms
{
/// <summary>
/// Simple struct for the (a,b,c,d) which is used to compute the mesage digest.
Expand Down
6 changes: 3 additions & 3 deletions DBTek.Crypto.Shared/CRC32.cs
@@ -1,5 +1,5 @@
using DBTek.Crypto.Extensions;
using DBTek.Crypto.Hashers;
using DBTek.Crypto.Algorithms;
using System;
using System.IO;

Expand All @@ -22,7 +22,7 @@ public string HashString(string sourceString)
{
if (sourceString != null)
{
using (var crc32 = new CRC32())
using (var crc32 = new CRC32Impl())
{
return crc32.ComputeChecksumAsString(sourceString.ToByteArray());
}
Expand All @@ -46,7 +46,7 @@ public string HashFile(string sourceFile)
throw new FileNotFoundException("Cannot find the specified source file", sourceFile ?? "null");

byte[] fileBytes = File.ReadAllBytes(sourceFile);
using (var crc32 = new CRC32())
using (var crc32 = new CRC32Impl())
{
return crc32.ComputeChecksumAsString(fileBytes);
}
Expand Down
4 changes: 2 additions & 2 deletions DBTek.Crypto.Shared/DBTek.Crypto.Shared.projitems
Expand Up @@ -13,8 +13,8 @@
<Compile Include="$(MSBuildThisFileDirectory)ClearData.cs" />
<Compile Include="$(MSBuildThisFileDirectory)CRC32.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Extensions\StringExtensions.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Hashers\CRC32Hasher.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Hashers\MD5Hasher.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Algorithms\CRC32Impl.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Algorithms\MD5Impl.cs" />
<Compile Include="$(MSBuildThisFileDirectory)IEncoder.cs" />
<Compile Include="$(MSBuildThisFileDirectory)IHasher.cs" />
<Compile Include="$(MSBuildThisFileDirectory)MD5.cs" />
Expand Down
4 changes: 2 additions & 2 deletions DBTek.Crypto.Shared/MD5.cs
Expand Up @@ -20,7 +20,7 @@ public class MD5_Hsr : IHasher
public string HashString(string sourceString)
{
if (sourceString != null)
return Hashers.MD5.GetHashString(sourceString);
return Algorithms.MD5.GetHashString(sourceString);
else
return String.Empty;
}
Expand All @@ -41,7 +41,7 @@ public string HashFile(string sourceFile)
throw new FileNotFoundException("Cannot find the specified source file", sourceFile ?? "null");

byte[] message = File.ReadAllBytes(sourceFile);
return Hashers.MD5.GetHashString(message);
return Algorithms.MD5.GetHashString(message);
}

#endregion
Expand Down
2 changes: 1 addition & 1 deletion DBTek.Crypto/Rijndael.cs
Expand Up @@ -242,7 +242,7 @@ public void DecodeFile(string sourceFile, string destFile, string password, stri
#region Utils

private byte[] GeneratePassword(string password)
=> Hashers.MD5.GetHash(password);
=> Algorithms.MD5.GetHash(password);

#endregion

Expand Down
2 changes: 1 addition & 1 deletion DBTek.Crypto/TripleDES.cs
Expand Up @@ -204,7 +204,7 @@ public void DecodeFile(String sourceFile, String destFile, String password, Stri
#region Utils

private byte[] GeneratePassword(string password)
=> Hashers.MD5.GetHash(password);
=> Algorithms.MD5.GetHash(password);

#endregion

Expand Down

0 comments on commit dfa088e

Please sign in to comment.