<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Rewriting the Wheel: bin2hex &#8211; hex2bin</title>
	<atom:link href="http://www.chesterproductions.net.nz/blogs/it/code/rewriting-the-wheel-bin2hex-hex2bin/34/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.chesterproductions.net.nz/blogs/it/code/rewriting-the-wheel-bin2hex-hex2bin/34/</link>
	<description>Simple code hopefully worth remembering</description>
	<lastBuildDate>Mon, 02 May 2011 17:33:36 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
	<item>
		<title>By: hello</title>
		<link>http://www.chesterproductions.net.nz/blogs/it/code/rewriting-the-wheel-bin2hex-hex2bin/34/comment-page-1/#comment-25</link>
		<dc:creator>hello</dc:creator>
		<pubDate>Mon, 02 May 2011 17:33:36 +0000</pubDate>
		<guid isPermaLink="false">http://www.chesterproductions.net.nz/blogs/it/?p=34#comment-25</guid>
		<description>Something I&#039;ve used in the past:

int hex2Bin(char c)
{
	int bin = 0, ten = 1, i;
	for (i = 0; i &lt; 8; i++)
	{
		bin += ((c &amp; (0x1 &lt;&lt;i&gt; 0x0) ? ten : 0;
		ten *= 10;
	}
	return bin;
}

...

printf(&quot;%08d&quot;, hex2Bin(c));</description>
		<content:encoded><![CDATA[<p>Something I&#8217;ve used in the past:</p>
<p>int hex2Bin(char c)<br />
{<br />
	int bin = 0, ten = 1, i;<br />
	for (i = 0; i &lt; 8; i++)<br />
	{<br />
		bin += ((c &amp; (0&#215;1 &lt;<i> 0&#215;0) ? ten : 0;<br />
		ten *= 10;<br />
	}<br />
	return bin;<br />
}</p>
<p>&#8230;</p>
<p>printf(&#8220;%08d&#8221;, hex2Bin(c));</i></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: admin</title>
		<link>http://www.chesterproductions.net.nz/blogs/it/code/rewriting-the-wheel-bin2hex-hex2bin/34/comment-page-1/#comment-9</link>
		<dc:creator>admin</dc:creator>
		<pubDate>Tue, 11 Nov 2008 08:30:08 +0000</pubDate>
		<guid isPermaLink="false">http://www.chesterproductions.net.nz/blogs/it/?p=34#comment-9</guid>
		<description>Oh yeah, for those of you who think that this is the best way of doing things, here&#039;s a hint:

printf(&quot;0x%02x&quot;,c);

Not every solution fits the same problem.</description>
		<content:encoded><![CDATA[<p>Oh yeah, for those of you who think that this is the best way of doing things, here&#8217;s a hint:</p>
<p>printf(&#8220;0x%02x&#8221;,c);</p>
<p>Not every solution fits the same problem.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

