unstorage icon indicating copy to clipboard operation
unstorage copied to clipboard

Allow slash as character in keys

Open pwFoo opened this issue 10 months ago • 0 comments

Describe the feature

My keys contain a SubtleCrypto.exportKey() strings which can contain slashes as character. So / should not handled as delimiter like : to work as expected.

Tested with memory driver.

db = createStorage()
db.set("MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEzM+xsV8fca/Gk/CgU4F2eyrblaqEcLdyjO4+X+ISs5sLwJHcJAGnG2axIyhYEVkjMUoL8+xWzDq+Wtd4wXrIlQ==:key1", "val1")

// correct matching...
await db.get("MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEzM+xsV8fca/Gk/CgU4F2eyrblaqEcLdyjO4+X+ISs5sLwJHcJAGnG2axIyhYEVkjMUoL8+xWzDq+Wtd4wXrIlQ==:key1")
// output: "val1"

// wrong machting key...
await db.get("MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEzM+xsV8fca:Gk:CgU4F2eyrblaqEcLdyjO4+X+ISs5sLwJHcJAGnG2axIyhYEVkjMUoL8+xWzDq+Wtd4wXrIlQ==:key1")
// output: "val1" but shouldn't exist!

Any way to configure delimiter or exclude "/"?

Additional information

  • [ ] Would you be willing to help implement this feature?

pwFoo avatar Jan 12 '25 15:01 pwFoo