You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

20 lines
350 B

using System;
namespace dotFionn.Checksum.Utils
{
public static class Extensions
{
public static int DigitSum(this int inInt)
{
int digitSum = 0;
while (inInt > 0) {
digitSum += inInt % 10;
inInt /= 10;
}
return digitSum;
}
}
}