Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: create filename from IP#

by dws (Chancellor)
on Nov 26, 2003 at 20:04 UTC ( [id://310365]=note: print w/replies, xml ) Need Help??


in reply to create filename from IP#

If you really must convert IP addresses to filenames, don't simply drop the period. If you do, you've introduced the equivalent of a hash collision, and can't tell whether "12345" came from 1.2.3.45, 1.2.34.5, 1.23.4.5, or 12.3.4.5.

Replies are listed 'Best First'.
Re: Re: create filename from IP#
by sauoq (Abbot) on Nov 26, 2003 at 20:41 UTC
    you've introduced the equivalent of a hash collision

    I think he was hoping to convert his filenames to 3 digits per octet in order to avoid that exact problem. Of course, removing the dots first won't work. And I don't understand why he'd remove the dots to "change it to a proper filename". An IP would make a fine filename, I'd think.

    Shrug. As others have pointed out, this isn't likely to be an effective approach to his problem anyway because a requestor's IP can change from request to request and an IP may be shared among many requestors.

    -sauoq
    "My two cents aren't worth a dime.";
    

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://310365]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chanting in the Monastery: (10)
As of 2024-04-23 08:16 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found