Class LongExtensions
Useful extension methods for System.Int64.
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
Namespace: IRM
Assembly: IRM.dll
Syntax
public static class LongExtensions
Methods
AddCheckNumber(Int64)
Calculates the check number according to the Luhn algoritm and adds it to the end.
Declaration
public static long AddCheckNumber(this long number)
Parameters
|
System.Int64
number
The System.Int64 to calculate and add check number for. |
Returns
|
System.Int64
The original |
FromUnixTimestamp(Int64)
Returns a DateTime (DateTimeKind.Utc) converted from a Unix timestamp.
Declaration
public static DateTime FromUnixTimestamp(this long unixTimestamp)
Parameters
|
System.Int64
unixTimestamp
The number of seconds that have elapsed since 00:00:00 UTC Thursday, 1 January 1970.. |
Returns
|
System.DateTime
The |
IsLuhn(Int64)
Gets if a string is valid according to the Luhn algoritm, for example a social security number.
Declaration
public static bool IsLuhn(this long number)
Parameters
|
System.Int64
number
The System.Int64 to check if it is valid according to the Luhn aloritm. |
Returns
|
Boolean
true if the string is valid according to the Luhn algoritm; otherwise false. |