<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://halfgeek.org/wiki/index.php?action=history&amp;feed=atom&amp;title=Hexadecimals_%28perl%29</id>
	<title>Hexadecimals (perl) - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://halfgeek.org/wiki/index.php?action=history&amp;feed=atom&amp;title=Hexadecimals_%28perl%29"/>
	<link rel="alternate" type="text/html" href="https://halfgeek.org/wiki/index.php?title=Hexadecimals_(perl)&amp;action=history"/>
	<updated>2026-05-28T12:26:13Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.34.0</generator>
	<entry>
		<id>https://halfgeek.org/wiki/index.php?title=Hexadecimals_(perl)&amp;diff=96&amp;oldid=prev</id>
		<title>161.253.9.181 at 15:00, 3 April 2005</title>
		<link rel="alternate" type="text/html" href="https://halfgeek.org/wiki/index.php?title=Hexadecimals_(perl)&amp;diff=96&amp;oldid=prev"/>
		<updated>2005-04-03T15:00:44Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;=Data string to hex=&lt;br /&gt;
&lt;br /&gt;
 # Convert data string to hex&lt;br /&gt;
 my $a = &amp;quot;ZYXWVUT&amp;quot;;&lt;br /&gt;
 my $ax = unpack(&amp;#039;H*&amp;#039;,$a);&lt;br /&gt;
 $ax eq &amp;#039;5a595857565554&amp;#039;&lt;br /&gt;
    or die &amp;quot;ax=$ax&amp;quot;;&lt;br /&gt;
 &lt;br /&gt;
 # Each character always becomes two hex digits,&lt;br /&gt;
 # even if the high half is 0&lt;br /&gt;
 my $b = pack(&amp;#039;C*&amp;#039;,1,2,3,4,5,6,7,8);&lt;br /&gt;
 my $bx = unpack(&amp;#039;H*&amp;#039;,$b);&lt;br /&gt;
 $bx eq &amp;#039;0102030405060708&amp;#039;&lt;br /&gt;
     or die &amp;quot;bx=$bx&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
=Hex string to data=&lt;br /&gt;
&lt;br /&gt;
 # Convert hex back to data string&lt;br /&gt;
 my $cx = &amp;quot;5a595857565554&amp;quot;;&lt;br /&gt;
 my $c = pack(&amp;#039;H*&amp;#039;,$cx);&lt;br /&gt;
 $c eq &amp;#039;ZYXWVUT&amp;#039;&lt;br /&gt;
     or die &amp;quot;c=$c&amp;quot;;&lt;br /&gt;
 &lt;br /&gt;
 # That leading zero in hex is important&lt;br /&gt;
 my $dx = &amp;#039;102030405060708&amp;#039;;&lt;br /&gt;
 my $d = pack(&amp;#039;H*&amp;#039;,$dx);&lt;br /&gt;
 $d ne pack(&amp;#039;C*&amp;#039;,1,2,3,4,5,6,7,8)&lt;br /&gt;
     or die &amp;quot;Forgotten leading zero didn&amp;#039;t matter&amp;quot;;&lt;/div&gt;</summary>
		<author><name>161.253.9.181</name></author>
		
	</entry>
</feed>