@@ -6,11 +6,11 @@ namespace IndriApollo.BelgianStructuredCommunication;
66
77public partial class Communication : IParsable < Communication >
88{
9- public uint Digits { get ; }
9+ public ulong Digits { get ; }
1010 public byte CheckSum { get ; }
1111 public bool ValidChecksum { get ; }
1212
13- public Communication ( uint digits ) : this ( digits . ToString ( "D10" ) )
13+ public Communication ( ulong digits ) : this ( digits . ToString ( "D10" ) )
1414 {
1515 }
1616
@@ -25,7 +25,7 @@ public Communication(string digits, string? checksum = null)
2525 if ( digits . Length != 10 )
2626 throw new ArgumentException ( "Digits must be 10 characters" , nameof ( digits ) ) ;
2727
28- Digits = uint . Parse ( digits , NumberStyles . None , CultureInfo . InvariantCulture ) ;
28+ Digits = ulong . Parse ( digits , NumberStyles . None , CultureInfo . InvariantCulture ) ;
2929
3030 var computedCheckSum = ComputeCheckSum ( Digits ) ;
3131 CheckSum = checksum is not null
@@ -89,7 +89,7 @@ public static bool TryParse([NotNullWhen(true)] string? s, IFormatProvider? prov
8989 return true ;
9090 }
9191
92- private static byte ComputeCheckSum ( uint digits )
92+ private static byte ComputeCheckSum ( ulong digits )
9393 {
9494 return ( byte ) ( digits % 97 ) ;
9595 }
@@ -104,5 +104,5 @@ public override string ToString()
104104 private static partial Regex CommunicationRegex ( ) ;
105105}
106106
107- public class InvalidChecksumException ( byte expected , byte actual , uint digits )
107+ public class InvalidChecksumException ( byte expected , byte actual , ulong digits )
108108 : Exception ( $ "Expected { expected : D2} but got { actual : D2} for { digits : D10} ") ;
0 commit comments