Skip to content

Commit

Permalink
Merge pull request #6 from Miiraak/v1.0.3.5
Browse files Browse the repository at this point in the history
V1.0.3.5
  • Loading branch information
Miiraak authored Aug 28, 2024
2 parents 8b74938 + 8754ea0 commit 43223ec
Show file tree
Hide file tree
Showing 8 changed files with 1,137 additions and 21 deletions.
7 changes: 0 additions & 7 deletions ClassicalCompendium.Tests/CryptoMethodsTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,5 @@ public void CodeAtBashTest()
Assert.Equal("Z Y X W", CryptoMethods.EncodeWithAtBash("a B c D"));
Assert.Equal("!()#%&|╱|洱妍洹|#{[]育╡為", CryptoMethods.EncodeWithAtBash("!()#%&|╱|洱妍洹|#{[]育╡為"));
}

[Fact]
public void DoSHA256Test()
{
Assert.Equal("e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", CryptoMethods.SHA256(""));
Assert.Equal("d7a8fbb307d7809469ca9abcb0082e4f8d5651e46d3cdb762d02d0bf37c9e592", CryptoMethods.SHA256("The quick brown fox jumps over the lazy dog"));
}
}
}
12 changes: 12 additions & 0 deletions ClassicalCompendium.Tests/HashMethodsTests.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
namespace ClassicalCompendium.Tests
{
public class HashMethodsTests
{
[Fact]
public void SHA256Test()
{
Assert.Equal("e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", HashMethods.SHA256(""));
Assert.Equal("d7a8fbb307d7809469ca9abcb0082e4f8d5651e46d3cdb762d02d0bf37c9e592", HashMethods.SHA256("The quick brown fox jumps over the lazy dog"));
}
}
}
56 changes: 56 additions & 0 deletions ClassicalCompendium.Tests/PreSetListsTests.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
namespace ClassicalCompendium.Tests
{
public class PreSetListsTests
{
[Fact]
public void MonthsTests()
{
Assert.Equal("January", PreSetLists.Time.Months[0]);
Assert.Equal("February", PreSetLists.Time.Months[1]);
Assert.Equal("March", PreSetLists.Time.Months[2]);
Assert.Equal(12, PreSetLists.Time.Months.Count);
}

[Fact]
public void DaysOfWeekTests()
{
Assert.Equal("Monday", PreSetLists.Time.WeekDays[0]);
Assert.Equal("Tuesday", PreSetLists.Time.WeekDays[1]);
Assert.Equal("Wednesday", PreSetLists.Time.WeekDays[2]);
Assert.Equal(7, PreSetLists.Time.WeekDays.Count);
}

[Fact]
public void HoursTests()
{
Assert.Equal("12 PM", PreSetLists.Time.Hours[0]);
Assert.Equal("1 AM", PreSetLists.Time.Hours[1]);
Assert.Equal("2 AM", PreSetLists.Time.Hours[2]);
Assert.Equal(24, PreSetLists.Time.Hours.Count);
}

[Fact]
public void CountryISOTests()
{
Assert.Equal("AF", PreSetLists.Country.CountryISO[0].Item2);
}

[Fact]
public void MostUsedLangagesTests()
{
Assert.Equal("English", PreSetLists.Country.MostUsedLangages[0]);
Assert.Equal("French", PreSetLists.Country.MostUsedLangages[1]);
Assert.Equal("Arabic", PreSetLists.Country.MostUsedLangages[2]);
Assert.Equal(10, PreSetLists.Country.MostUsedLangages.Count);
}

[Fact]
public void OfficialLanguagesTests()
{
Assert.Equal("Abkhaz", PreSetLists.Country.OfficialLanguages[0]);
Assert.Equal("Armenian", PreSetLists.Country.OfficialLanguages[9]);
Assert.Equal("Bedik", PreSetLists.Country.OfficialLanguages[18]);
Assert.Equal(214, PreSetLists.Country.OfficialLanguages.Count);
}
}
}
5 changes: 3 additions & 2 deletions ClassicalCompendium.sln
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.10.35201.131
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ClassicalCompendium", "ClassicalCompendium\ClassicalCompendium.csproj", "{645133BB-A893-4E8B-8963-F889582A4CE6}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ClassicalCompendium", "ClassicalCompendium\ClassicalCompendium.csproj", "{645133BB-A893-4E8B-8963-F889582A4CE6}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ClassicalCompendium.Tests", "ClassicalCompendium.Tests\ClassicalCompendium.Tests.csproj", "{A86ECB33-806C-4C08-ACEA-BD2709BD2851}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ClassicalCompendium.Tests", "ClassicalCompendium.Tests\ClassicalCompendium.Tests.csproj", "{A86ECB33-806C-4C08-ACEA-BD2709BD2851}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand All @@ -18,6 +18,7 @@ Global
{645133BB-A893-4E8B-8963-F889582A4CE6}.Release|Any CPU.ActiveCfg = Release|Any CPU
{645133BB-A893-4E8B-8963-F889582A4CE6}.Release|Any CPU.Build.0 = Release|Any CPU
{A86ECB33-806C-4C08-ACEA-BD2709BD2851}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{A86ECB33-806C-4C08-ACEA-BD2709BD2851}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A86ECB33-806C-4C08-ACEA-BD2709BD2851}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A86ECB33-806C-4C08-ACEA-BD2709BD2851}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
Expand Down
2 changes: 1 addition & 1 deletion ClassicalCompendium/ClassicalCompendium.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<Company></Company>
<Description>A collection of widely-used C# utility methods </Description>
<EnablePackageValidation>true</EnablePackageValidation>
<PackageTags>Compendium; Random; Cryptography</PackageTags>
<PackageTags>Compendium; Random; Cryptography; Numeral;</PackageTags>
<RepositoryUrl>https://github.com/Miiraak/ClassicalCompendium</RepositoryUrl>
<PackageReadmeFile>README.md</PackageReadmeFile>
<PackageLicenseFile>LICENSE</PackageLicenseFile>
Expand Down
11 changes: 0 additions & 11 deletions ClassicalCompendium/CryptoMethods.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
using System;
using System.Collections.Generic;
using System.Text;

namespace ClassicalCompendium
{
Expand Down Expand Up @@ -61,15 +60,5 @@ public static string EncodeWithAtBash(string Text)
}
return output;
}

public static string SHA256(string text)
{
using (var sha256 = System.Security.Cryptography.SHA256.Create())
{
byte[] bytes = Encoding.UTF8.GetBytes(text);
byte[] hash = sha256.ComputeHash(bytes);
return BitConverter.ToString(hash).Replace("-", "").ToLower();
}
}
}
}
Loading

0 comments on commit 43223ec

Please sign in to comment.