diff --git a/Disco.Services/Documents/DocumentUniqueIdentifierExtensions.cs b/Disco.Services/Documents/DocumentUniqueIdentifierExtensions.cs index 8adf7efb..312f922b 100644 --- a/Disco.Services/Documents/DocumentUniqueIdentifierExtensions.cs +++ b/Disco.Services/Documents/DocumentUniqueIdentifierExtensions.cs @@ -94,12 +94,11 @@ public static bool TryBinaryNumericEncode(string Data, out byte[] Result) Result = new byte[4]; int leadingZeros = 0; - for (leadingZeros = 0; leadingZeros <= 4; leadingZeros++) + for (int i = 0; i < Data.Length; i++) { if (Data[leadingZeros] != '0') - { break; - } + leadingZeros++; } if (leadingZeros <= 3)