Open
Description
Thus letting end user to adjust their seed format as needed, instead of jumping in-between of base32 padding / non-padding as currently.
BufferSource
as input type of crypto.subtle.importKey("raw", _)
, which is both OK for Uint8Array
or ArrayBuffer
.
Btw, this feature suggestion is breaking change as semver major, but I think it'd worthwhile.
Activity
lowlighter commentedon Sep 28, 2024
Could you provide a snippet of what you'd like the API to look like ?
Currently there are a lot of conversions indeed, but it's mostly because it's expected that users would want to work with strings (either to store in db, to generate the qr code, to display to user, etc.)
I'd like to visualise your use-case better, I confess this lib was mostly done for 2FA with an authenticator app but maybe there are others usage for it that the current api make impractical ?
It's ok the versioning process is entirely automated and I don't mind increasing major anyways
imcotton commentedon Sep 28, 2024
Please checkout the draft in diff below:
User now need extra help
readBase32
to supply thesecret
, but this way they're free to useUUID
orsha256(seed)
as needed.imcotton commentedon Oct 7, 2024
Hey, shall I close the ticket if it's not ideal to your current aiming? I don't want to put too much of maintaining labor to you since I can get around for my own need here.
lowlighter commentedon Oct 8, 2024
It's fine to leave it open, no worries
I'm working on other projects right now but I'll eventually take a look at it when I have some spare time
imcotton commentedon Oct 8, 2024
Got it, this is low priority to me, nothing urgent as well.