Skip to content

Instantly share code, notes, and snippets.

@tt
tt / Owin.cs
Created December 8, 2010 21:22
public interface IApplication
{
IResponse Respond(IRequest request);
}
public interface IRequest
{
string Method { get; }
string Uri { get; }
public long CalculateChecksum(long value)
{
long sum = 0;
for (int i = 0; value != 0; i++)
{
for (var j = (value % 10) * (2 - i % 2); j != 0; j /= 10)
{
sum += j % 10;
}
value /= 10;