Remove trailing space left at the end of the binary string
This commit is contained in:
parent
afc7c92f22
commit
9e8bee43c8
1
BaseConverter/Form1.Designer.cs
generated
1
BaseConverter/Form1.Designer.cs
generated
@ -302,6 +302,7 @@ namespace WindowsFormsApplication1
|
|||||||
//
|
//
|
||||||
// label1
|
// label1
|
||||||
//
|
//
|
||||||
|
this.label1.Font = new System.Drawing.Font("Microsoft Sans Serif", 7F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||||
this.label1.Location = new System.Drawing.Point(7, 39);
|
this.label1.Location = new System.Drawing.Point(7, 39);
|
||||||
this.label1.Name = "label1";
|
this.label1.Name = "label1";
|
||||||
this.label1.Size = new System.Drawing.Size(76, 14);
|
this.label1.Size = new System.Drawing.Size(76, 14);
|
||||||
|
@ -48,10 +48,7 @@ namespace WindowsFormsApplication1
|
|||||||
decimalNum = long.Parse(decimalTextBox.Text);
|
decimalNum = long.Parse(decimalTextBox.Text);
|
||||||
hexNum = Convert.ToInt64(hexTextBox.Text, 16);
|
hexNum = Convert.ToInt64(hexTextBox.Text, 16);
|
||||||
// Remove spacing from binaryTextBox before parsing it
|
// Remove spacing from binaryTextBox before parsing it
|
||||||
//if (spacingToggle.Checked)
|
|
||||||
//{
|
|
||||||
binaryTextBox.Text = binaryTextBox.Text.Replace(" ", "");
|
binaryTextBox.Text = binaryTextBox.Text.Replace(" ", "");
|
||||||
//}
|
|
||||||
binNum = Convert.ToInt64(binaryTextBox.Text, 2);
|
binNum = Convert.ToInt64(binaryTextBox.Text, 2);
|
||||||
octalNum = Convert.ToInt64(octalTextBox.Text, 8);
|
octalNum = Convert.ToInt64(octalTextBox.Text, 8);
|
||||||
paddingOffset = int.Parse(paddingOffsetTextBox.Text);
|
paddingOffset = int.Parse(paddingOffsetTextBox.Text);
|
||||||
@ -130,6 +127,8 @@ namespace WindowsFormsApplication1
|
|||||||
i = binarySize;
|
i = binarySize;
|
||||||
var builder = new StringBuilder(binaryString); // String builder
|
var builder = new StringBuilder(binaryString); // String builder
|
||||||
while (i != 0)
|
while (i != 0)
|
||||||
|
{
|
||||||
|
if (!(i == binarySize)) // Get rid of trailing space
|
||||||
{
|
{
|
||||||
if (i % spacingOffset == 0) // If i mod spacingOffset equals zero, append a space to the offset specified by i.
|
if (i % spacingOffset == 0) // If i mod spacingOffset equals zero, append a space to the offset specified by i.
|
||||||
{
|
{
|
||||||
@ -137,6 +136,11 @@ namespace WindowsFormsApplication1
|
|||||||
}
|
}
|
||||||
i--;
|
i--;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
i--;
|
||||||
|
}
|
||||||
|
}
|
||||||
binaryTextBox.Text = builder.ToString();
|
binaryTextBox.Text = builder.ToString();
|
||||||
builder = null; // null out builder when done
|
builder = null; // null out builder when done
|
||||||
//binaryTextBox.Text = binaryString;
|
//binaryTextBox.Text = binaryString;
|
||||||
|
@ -11,7 +11,7 @@
|
|||||||
<dsig:Transform Algorithm="urn:schemas-microsoft-com:HashTransforms.Identity" />
|
<dsig:Transform Algorithm="urn:schemas-microsoft-com:HashTransforms.Identity" />
|
||||||
</dsig:Transforms>
|
</dsig:Transforms>
|
||||||
<dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
|
<dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
|
||||||
<dsig:DigestValue>is8iki4tHpHxcj7xk6PtMOGvK6g=</dsig:DigestValue>
|
<dsig:DigestValue>iQndC8edrYzQfW1up66sZRa2OHI=</dsig:DigestValue>
|
||||||
</hash>
|
</hash>
|
||||||
</dependentAssembly>
|
</dependentAssembly>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
Binary file not shown.
@ -59,7 +59,7 @@
|
|||||||
<dsig:Transform Algorithm="urn:schemas-microsoft-com:HashTransforms.Identity" />
|
<dsig:Transform Algorithm="urn:schemas-microsoft-com:HashTransforms.Identity" />
|
||||||
</dsig:Transforms>
|
</dsig:Transforms>
|
||||||
<dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
|
<dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
|
||||||
<dsig:DigestValue>TKjFfY6QSkvgFQb19kmMEE77U3c=</dsig:DigestValue>
|
<dsig:DigestValue>wI+p03vYZj52eZR1ghmskX9GKkg=</dsig:DigestValue>
|
||||||
</hash>
|
</hash>
|
||||||
</dependentAssembly>
|
</dependentAssembly>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
Binary file not shown.
@ -11,7 +11,7 @@
|
|||||||
<dsig:Transform Algorithm="urn:schemas-microsoft-com:HashTransforms.Identity" />
|
<dsig:Transform Algorithm="urn:schemas-microsoft-com:HashTransforms.Identity" />
|
||||||
</dsig:Transforms>
|
</dsig:Transforms>
|
||||||
<dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
|
<dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
|
||||||
<dsig:DigestValue>is8iki4tHpHxcj7xk6PtMOGvK6g=</dsig:DigestValue>
|
<dsig:DigestValue>iQndC8edrYzQfW1up66sZRa2OHI=</dsig:DigestValue>
|
||||||
</hash>
|
</hash>
|
||||||
</dependentAssembly>
|
</dependentAssembly>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
@ -11,7 +11,7 @@
|
|||||||
<dsig:Transform Algorithm="urn:schemas-microsoft-com:HashTransforms.Identity" />
|
<dsig:Transform Algorithm="urn:schemas-microsoft-com:HashTransforms.Identity" />
|
||||||
</dsig:Transforms>
|
</dsig:Transforms>
|
||||||
<dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
|
<dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
|
||||||
<dsig:DigestValue>is8iki4tHpHxcj7xk6PtMOGvK6g=</dsig:DigestValue>
|
<dsig:DigestValue>iQndC8edrYzQfW1up66sZRa2OHI=</dsig:DigestValue>
|
||||||
</hash>
|
</hash>
|
||||||
</dependentAssembly>
|
</dependentAssembly>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
Binary file not shown.
Binary file not shown.
@ -59,7 +59,7 @@
|
|||||||
<dsig:Transform Algorithm="urn:schemas-microsoft-com:HashTransforms.Identity" />
|
<dsig:Transform Algorithm="urn:schemas-microsoft-com:HashTransforms.Identity" />
|
||||||
</dsig:Transforms>
|
</dsig:Transforms>
|
||||||
<dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
|
<dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
|
||||||
<dsig:DigestValue>TKjFfY6QSkvgFQb19kmMEE77U3c=</dsig:DigestValue>
|
<dsig:DigestValue>wI+p03vYZj52eZR1ghmskX9GKkg=</dsig:DigestValue>
|
||||||
</hash>
|
</hash>
|
||||||
</dependentAssembly>
|
</dependentAssembly>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user