'Return a hash path to use internally in the db for the given dir.'

def dhash_from_dir(self, dir):

    if isinstance(dir, unicode):
        dir = dir.encode(sys.getfilesystemencoding())
    return md5(dir).hexdigest()
