Hi i am looking to save the html of urls. In an ideal world I would use the url as the file name - however given urls often contain special characters, this is not going to be possible.
What i want is a way of converting the url into a 'code' which can then use as the file name. I also need a way of being able to go back as well (i.e. from the file name to the original url).
I am assuming that the best way of doing this is hashing in some way, but not sure where to start. I will be working in Python, so ideally want something of the form:
def url_to_file_name ():
...
return (file_name)
def file_name_to_url ():
...
return (url)