Skip to content

Commit

Permalink
Added sample program. Fixed namespace and assembly names.
Browse files Browse the repository at this point in the history
  • Loading branch information
invertedtomato committed Feb 2, 2019
1 parent 271690a commit bdac38c
Show file tree
Hide file tree
Showing 7 changed files with 111 additions and 52 deletions.
116 changes: 68 additions & 48 deletions InvertedTomato.Crc.sln
Original file line number Diff line number Diff line change
@@ -1,48 +1,68 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.26124.0
MinimumVisualStudioVersion = 15.0.26124.0
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "library", "library\library.csproj", "{237C5C62-71BC-4857-A6CE-E41169B42AF4}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "tests", "tests\tests.csproj", "{7D2DA1FF-984C-48D5-AAF2-BCD2BBDA9954}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Debug|x64 = Debug|x64
Debug|x86 = Debug|x86
Release|Any CPU = Release|Any CPU
Release|x64 = Release|x64
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{237C5C62-71BC-4857-A6CE-E41169B42AF4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{237C5C62-71BC-4857-A6CE-E41169B42AF4}.Debug|Any CPU.Build.0 = Debug|Any CPU
{237C5C62-71BC-4857-A6CE-E41169B42AF4}.Debug|x64.ActiveCfg = Debug|Any CPU
{237C5C62-71BC-4857-A6CE-E41169B42AF4}.Debug|x64.Build.0 = Debug|Any CPU
{237C5C62-71BC-4857-A6CE-E41169B42AF4}.Debug|x86.ActiveCfg = Debug|Any CPU
{237C5C62-71BC-4857-A6CE-E41169B42AF4}.Debug|x86.Build.0 = Debug|Any CPU
{237C5C62-71BC-4857-A6CE-E41169B42AF4}.Release|Any CPU.ActiveCfg = Release|Any CPU
{237C5C62-71BC-4857-A6CE-E41169B42AF4}.Release|Any CPU.Build.0 = Release|Any CPU
{237C5C62-71BC-4857-A6CE-E41169B42AF4}.Release|x64.ActiveCfg = Release|Any CPU
{237C5C62-71BC-4857-A6CE-E41169B42AF4}.Release|x64.Build.0 = Release|Any CPU
{237C5C62-71BC-4857-A6CE-E41169B42AF4}.Release|x86.ActiveCfg = Release|Any CPU
{237C5C62-71BC-4857-A6CE-E41169B42AF4}.Release|x86.Build.0 = Release|Any CPU
{7D2DA1FF-984C-48D5-AAF2-BCD2BBDA9954}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{7D2DA1FF-984C-48D5-AAF2-BCD2BBDA9954}.Debug|Any CPU.Build.0 = Debug|Any CPU
{7D2DA1FF-984C-48D5-AAF2-BCD2BBDA9954}.Debug|x64.ActiveCfg = Debug|Any CPU
{7D2DA1FF-984C-48D5-AAF2-BCD2BBDA9954}.Debug|x64.Build.0 = Debug|Any CPU
{7D2DA1FF-984C-48D5-AAF2-BCD2BBDA9954}.Debug|x86.ActiveCfg = Debug|Any CPU
{7D2DA1FF-984C-48D5-AAF2-BCD2BBDA9954}.Debug|x86.Build.0 = Debug|Any CPU
{7D2DA1FF-984C-48D5-AAF2-BCD2BBDA9954}.Release|Any CPU.ActiveCfg = Release|Any CPU
{7D2DA1FF-984C-48D5-AAF2-BCD2BBDA9954}.Release|Any CPU.Build.0 = Release|Any CPU
{7D2DA1FF-984C-48D5-AAF2-BCD2BBDA9954}.Release|x64.ActiveCfg = Release|Any CPU
{7D2DA1FF-984C-48D5-AAF2-BCD2BBDA9954}.Release|x64.Build.0 = Release|Any CPU
{7D2DA1FF-984C-48D5-AAF2-BCD2BBDA9954}.Release|x86.ActiveCfg = Release|Any CPU
{7D2DA1FF-984C-48D5-AAF2-BCD2BBDA9954}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
EndGlobal

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.26124.0
MinimumVisualStudioVersion = 15.0.26124.0
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "library", "library\library.csproj", "{237C5C62-71BC-4857-A6CE-E41169B42AF4}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "tests", "tests\tests.csproj", "{7D2DA1FF-984C-48D5-AAF2-BCD2BBDA9954}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Other", "Other", "{94AEE161-10DB-4514-B43C-F8B73BBE2252}"
ProjectSection(SolutionItems) = preProject
README.md = README.md
Reference\crc_v3.txt = Reference\crc_v3.txt
EndProjectSection
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Sample", "Sample\Sample.csproj", "{A272605E-01A9-4E73-BDF0-75FF8B208ECB}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Debug|x64 = Debug|x64
Debug|x86 = Debug|x86
Release|Any CPU = Release|Any CPU
Release|x64 = Release|x64
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{237C5C62-71BC-4857-A6CE-E41169B42AF4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{237C5C62-71BC-4857-A6CE-E41169B42AF4}.Debug|Any CPU.Build.0 = Debug|Any CPU
{237C5C62-71BC-4857-A6CE-E41169B42AF4}.Debug|x64.ActiveCfg = Debug|Any CPU
{237C5C62-71BC-4857-A6CE-E41169B42AF4}.Debug|x64.Build.0 = Debug|Any CPU
{237C5C62-71BC-4857-A6CE-E41169B42AF4}.Debug|x86.ActiveCfg = Debug|Any CPU
{237C5C62-71BC-4857-A6CE-E41169B42AF4}.Debug|x86.Build.0 = Debug|Any CPU
{237C5C62-71BC-4857-A6CE-E41169B42AF4}.Release|Any CPU.ActiveCfg = Release|Any CPU
{237C5C62-71BC-4857-A6CE-E41169B42AF4}.Release|Any CPU.Build.0 = Release|Any CPU
{237C5C62-71BC-4857-A6CE-E41169B42AF4}.Release|x64.ActiveCfg = Release|Any CPU
{237C5C62-71BC-4857-A6CE-E41169B42AF4}.Release|x64.Build.0 = Release|Any CPU
{237C5C62-71BC-4857-A6CE-E41169B42AF4}.Release|x86.ActiveCfg = Release|Any CPU
{237C5C62-71BC-4857-A6CE-E41169B42AF4}.Release|x86.Build.0 = Release|Any CPU
{7D2DA1FF-984C-48D5-AAF2-BCD2BBDA9954}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{7D2DA1FF-984C-48D5-AAF2-BCD2BBDA9954}.Debug|Any CPU.Build.0 = Debug|Any CPU
{7D2DA1FF-984C-48D5-AAF2-BCD2BBDA9954}.Debug|x64.ActiveCfg = Debug|Any CPU
{7D2DA1FF-984C-48D5-AAF2-BCD2BBDA9954}.Debug|x64.Build.0 = Debug|Any CPU
{7D2DA1FF-984C-48D5-AAF2-BCD2BBDA9954}.Debug|x86.ActiveCfg = Debug|Any CPU
{7D2DA1FF-984C-48D5-AAF2-BCD2BBDA9954}.Debug|x86.Build.0 = Debug|Any CPU
{7D2DA1FF-984C-48D5-AAF2-BCD2BBDA9954}.Release|Any CPU.ActiveCfg = Release|Any CPU
{7D2DA1FF-984C-48D5-AAF2-BCD2BBDA9954}.Release|Any CPU.Build.0 = Release|Any CPU
{7D2DA1FF-984C-48D5-AAF2-BCD2BBDA9954}.Release|x64.ActiveCfg = Release|Any CPU
{7D2DA1FF-984C-48D5-AAF2-BCD2BBDA9954}.Release|x64.Build.0 = Release|Any CPU
{7D2DA1FF-984C-48D5-AAF2-BCD2BBDA9954}.Release|x86.ActiveCfg = Release|Any CPU
{7D2DA1FF-984C-48D5-AAF2-BCD2BBDA9954}.Release|x86.Build.0 = Release|Any CPU
{A272605E-01A9-4E73-BDF0-75FF8B208ECB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{A272605E-01A9-4E73-BDF0-75FF8B208ECB}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A272605E-01A9-4E73-BDF0-75FF8B208ECB}.Debug|x64.ActiveCfg = Debug|Any CPU
{A272605E-01A9-4E73-BDF0-75FF8B208ECB}.Debug|x64.Build.0 = Debug|Any CPU
{A272605E-01A9-4E73-BDF0-75FF8B208ECB}.Debug|x86.ActiveCfg = Debug|Any CPU
{A272605E-01A9-4E73-BDF0-75FF8B208ECB}.Debug|x86.Build.0 = Debug|Any CPU
{A272605E-01A9-4E73-BDF0-75FF8B208ECB}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A272605E-01A9-4E73-BDF0-75FF8B208ECB}.Release|Any CPU.Build.0 = Release|Any CPU
{A272605E-01A9-4E73-BDF0-75FF8B208ECB}.Release|x64.ActiveCfg = Release|Any CPU
{A272605E-01A9-4E73-BDF0-75FF8B208ECB}.Release|x64.Build.0 = Release|Any CPU
{A272605E-01A9-4E73-BDF0-75FF8B208ECB}.Release|x86.ActiveCfg = Release|Any CPU
{A272605E-01A9-4E73-BDF0-75FF8B208ECB}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
EndGlobal
4 changes: 2 additions & 2 deletions Library/Library.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
<RepositoryUrl>https://github.com/invertedtomato/crc</RepositoryUrl>
<RepositoryType>git</RepositoryType>
<PackageTags>crc,crc8,crc16,crc32,crc64,hash</PackageTags>
<PackageVersion>1.0.2</PackageVersion>
<PackageVersion>1.1.0</PackageVersion>
<AssemblyName>InvertedTomato.Crc</AssemblyName>
<RootNamespace>InvertedTomato.Checksum</RootNamespace>
<RootNamespace>InvertedTomato.IO</RootNamespace>
<PackageId>InvertedTomato.Crc</PackageId>
</PropertyGroup>

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
## TLDR; How do I make it go?
```c#
// Create a new instance of Crc using the algorithm of your choice
var crc = new CrcAlgorithm.CreateCrc16CcittFalse();
var crc = CrcAlgorithm.CreateCrc16CcittFalse();

// Give it some bytes to chew on - you can call this multiple times if needed
crc.Append(Encoding.ASCII.GetBytes("Hurray for cake!"));
Expand Down
21 changes: 21 additions & 0 deletions Sample/Program.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
using System;
using System.Text;
using InvertedTomato.IO;

namespace Sample
{
class Program
{
static void Main(string[] args)
{
// Create a new instance of Crc using the algorithm of your choice
var crc = CrcAlgorithm.CreateCrc16CcittFalse();

// Give it some bytes to chew on - you can call this multiple times if needed
crc.Append(Encoding.ASCII.GetBytes("Hurray for cake!"));

// Get the output - as a hex string, byte array or unsigned integer
Console.WriteLine(crc.ToHexString());
}
}
}
14 changes: 14 additions & 0 deletions Sample/Sample.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<Project Sdk="Microsoft.NET.Sdk">

<ItemGroup>
<ProjectReference Include="..\Library\Library.csproj" />
</ItemGroup>

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp2.1</TargetFramework>
<AssemblyName>InvertedTomato.Crc.Sample</AssemblyName>
<IsPackable>false</IsPackable>
</PropertyGroup>

</Project>
2 changes: 1 addition & 1 deletion Tests/Crc16Ccitt.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace InvertedTomato.IO
{
public static class Crc16Ccitt // http://sanity-free.org/133/crc_16_ccitt_in_csharp.html
public static class Crc16Ccitt // Rival test algorithm adapted from http://sanity-free.org/133/crc_16_ccitt_in_csharp.html
{
private const ushort Poly = 4129;
private static readonly ushort[] Table = new ushort[256];
Expand Down
4 changes: 4 additions & 0 deletions Tests/Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
<TargetFramework>netcoreapp2.1</TargetFramework>

<IsPackable>false</IsPackable>

<AssemblyName>InvertedTomato.Crc.Tests</AssemblyName>

<RootNamespace>InvertedTomato.IO</RootNamespace>
</PropertyGroup>

<ItemGroup>
Expand Down

0 comments on commit bdac38c

Please sign in to comment.