This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public interface IApplication | |
{ | |
IResponse Respond(IRequest request); | |
} | |
public interface IRequest | |
{ | |
string Method { get; } | |
string Uri { get; } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
NewerOlder