<?xml version="1.0" encoding="windows-1252"?>
<node id="1014446" title="Re: Uniquely identifying each &amp; every html template" created="2013-01-21 08:38:52" updated="2013-01-21 08:38:52">
<type id="11">
note</type>
<author id="171588">
BrowserUk</author>
<data>
<field name="doctext">
&lt;blockquote&gt;&lt;i&gt;
My question is HOW am i suppose to identify each and every html webpage i have, without the need of editing and embedding a string containing a number for them.
&lt;/i&gt;&lt;/blockquote&gt;

&lt;p&gt;The full pathname of each file is already a unique identifier, why do you need a number also?

&lt;p&gt;Converting the unique name to a unique number can be done in any number of ways:

&lt;ul&gt;&lt;li&gt;Put a list of all the paths into a file and then number them;
&lt;/li&gt;&lt;li&gt;On *nix, the node id should be unique;
&lt;/li&gt;&lt;li&gt;md5 the path;
&lt;/li&gt;&lt;li&gt;crc64 the path;
&lt;/li&gt;&lt;li&gt;A custom hashing function:&lt;code&gt;
sub id{ my $n = 0; $n = ( $n &lt;&lt; 1 ^ $_ ) for unpack 'Q(X7Q)*', $_[0]; $n };;

print id( $_ ), ' : ', $_ for qw[
/home/nikos/public_html/folder/subfolder/index2.html 
/home/nikos/public_html/folder/subfoldre/index2.html 
/homa/nikos/public_html/folder/subfolder/index2.html 
/home/nikos/public_html/folder/subfoldre/index.html 
/home/nikos/public_html/folder/subfolder/index.html 
];;
14395874431259872676  :  /home/nikos/public_html/folder/subfolder/index2.html
18362554206005274164  :  /home/nikos/public_html/folder/subfoldre/index2.html
14252040718160727460  :  /homa/nikos/public_html/folder/subfolder/index2.html
534634562378736008  :  /home/nikos/public_html/folder/subfoldre/index.html
2010048469067125824  :  /home/nikos/public_html/folder/subfolder/index.html
&lt;/code&gt;
&lt;/li&gt;&lt;/ul&gt;

&lt;div class="pmsig"&gt;&lt;div class="pmsig-171588"&gt;
&lt;hr /&gt;
&lt;font size=1 &gt;
&lt;div&gt;With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'&lt;/div&gt;
&lt;div&gt;Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.&lt;/div&gt;
&lt;div&gt;"Science is about questioning the status quo. Questioning authority". &lt;/div&gt;
&lt;div&gt;In the absence of evidence, opinion is indistinguishable from prejudice.
&lt;/div&gt;
&lt;/font&gt;

&lt;/div&gt;&lt;/div&gt;</field>
<field name="root_node">
1014433</field>
<field name="parent_node">
1014433</field>
</data>
</node>
