Perhaps using GUIDs?

Linux etc.:

myMac:~ karl: uuidgen EBB88FE7-1262-43BD-9017-7CAEEA2E8627

Windows, using Powershell:

PS C:\Documents and settings\karl> [System.Guid]::NewGuid().ToString() 995187c6-993a-41e3-b249-e2c013d71c73

Should be unique enough. There are also some Modules for this on but i didn't use them.

Update:

I knew i saw something interesting about this some time ago: Generate GUID from a string by GrandFather.

Update 2:

Btw...i posted already some other variations on this "unique" stuff...

#!/usr/bin/perl + + use strict; use warnings; my ( @l, @u, @n, @p, $i, $j ); open( URANDOM, "</dev/urandom" ) || die $!; read( URANDOM, $_, 4 ); close URANDOM; srand( unpack( "L", $_ ) ); @l = ( "a" .. "z" ); @u = ( "A" .. "Z" ); @n = ( 0 .. 9 ); push( @p, splice( @l, int( rand(@l) ), 1 ) ) for ( 1 .. 10 ); push( @p, splice( @u, int( rand(@u) ), 1 ) ) for ( 1 .. 10 ); push( @p, splice( @n, int( rand(@n) ), 1 ) ) for ( 1 .. 2 ); for ( $i = @p ; --$i ; ) { $j = int( rand( $i + 1 ) ); next if $i == $j; @p[ $i, $j ] = @p[ $j, $i ]; } print join( "", @p ) . qq(\n); __END__ Karls-Mac-mini:monks karl$ ./random_filename.pl gRjyL1ivolIPHsJx0MCSeQ

...and i still think that this is not a bad ("easy") approach - if you don't plan to deploy world wide ;-)

Regards, Karl

«The Crux of the Biscuit is the Apostrophe»


In reply to Re: unique file ID by karlgoethebier
in thread unique file ID by baxy77bax

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.