To do so, I need to decode the x parameter which is encoded in base64url.
I'm expecting to either be able to use the procedural method via multibase.decode() because I would prefix the string with the proper base64url flag u, or use the object-oriented style via multibase.get("base64url").decode(), without having to prefix the string.
multibase.decode("u" + "1IFOwqNRAXr7bxkzsaUP4c5TsfODswA3L8EZYoaWP08") # works
multibase.get("base64url").decode("u" + "1IFOwqNRAXr7bxkzsaUP4c5TsfODswA3L8EZYoaWP08") # works
multibase.get("base64url").decode("1IFOwqNRAXr7bxkzsaUP4c5TsfODswA3L8EZYoaWP08") # fails
> multiformats.multibase.err.MultibaseKeyError: 'No known multibase code is a prefix of the given string.'
What is the point of getting the Multibase object if we still have to prefix the string ?
Hi,
I'm trying to transform a JWK into a
did:key
The JWK is defined as
To do so, I need to decode the
x
parameter which is encoded inbase64url
.I'm expecting to either be able to use the procedural method via
multibase.decode()
because I would prefix the string with the properbase64url
flagu
, or use the object-oriented style viamultibase.get("base64url").decode()
, without having to prefix the string.What is the point of getting the Multibase object if we still have to prefix the string ?
Is that the expected behavior ?
Best regards