def from_hash(hash)
      # restore missing '='
      len = hash.length % 4
      hash += '==' if len == 1 or len == 2
      hash += '=' if len == 3

      decoded_hash = Base64.urlsafe_decode64(hash)
      decoded_hash = decoded_hash.respond_to?(:force_encoding) ? decoded_hash.force_encoding('utf-8') : decoded_hash
      pathname = @root + decoded_hash
    rescue ArgumentError => e
      if e.message != 'invalid base64'
        raise
      end
      nil
    end
def from_hash(hash)
      # restore missing '='
      len = hash.length % 4
      hash += '==' if len == 1 or len == 2
      hash += '=' if len == 3

      decoded_hash = Base64.urlsafe_decode64(hash)
      decoded_hash = decoded_hash.respond_to?(:force_encoding) ? decoded_hash.force_encoding('utf-8') : decoded_hash
      pathname = @root + decoded_hash
    rescue ArgumentError => e
      if e.message != 'invalid base64'
        raise
      end
      nil
    end
of to_hash