packageflatfsimport("github.com/ipfs/go-datastore")// keyIsValid returns true if the key is valid for flatfs.// Allows keys that match [0-9A-Z+-_=].funckeyIsValid(keydatastore.Key)bool{ks:=key.String()iflen(ks)<2||ks[0]!='/'{returnfalse}for_,b:=rangeks[1:]{if'0'<=b&&b<='9'{continue}if'A'<=b&&b<='Z'{continue}switchb{case'+','-','_','=':continue}returnfalse}returntrue}