Neos.IdentityServer 3.0/Neos.IdentityServer.QrCodeNet/EncodingRegion/BCHCalculator.cs
/// <summary>
/// Search for right side bit of Most significant bit
/// </summary>
/// <param name="num">input number</param>
/// <param name="lowBoundary">lower boundary. At start should be 0</param>
/// <param name="highBoundary">higher boundary. At start should be 32</param>
/// <returns>Most significant bit - 1</returns>
Search for right side bit of Most significant bit
Search for right side bit of Most significant bit
private static int BinarySearchPos(int num, int lowBoundary, int highBoundary)
		{
			int mid = (lowBoundary + highBoundary) / 2;
			int shiftResult = num >> mid;
			if(shiftResult == 1)
				return mid;
			else if(shiftResult < 1)
				return BinarySearchPos(num, lowBoundary, mid);
			else
				return BinarySearchPos(num, mid, highBoundary);
		}
private static int BinarySearchPos ( int num , int lowBoundary , int highBoundary ) { int mid = ( lowBoundary + highBoundary ) / 2 ; int shiftResult = num >> mid ; if ( shiftResult == 1 ) return mid ; else if ( shiftResult < 1 ) return BinarySearchPos ( num , lowBoundary , mid ) ; else return BinarySearchPos ( num , mid , highBoundary ) ; }
Search for right side bit of Most significant bit
Search for right side bit of Most significant bit
Most significant bit - 1
Most significant bit - 1
num
int
None
lowBoundary
int
lower boundary. At start should be 0
lower boundary . At start should be 0
highBoundary
int
higher boundary. At start should be 32
higher boundary . At start should be 32