vert-x3 / vertx-4-migration-guide

Migration to Vert.x 4 guide
https://vert-x3.github.io/vertx-4-migration-guide/index.html
20 stars 16 forks source link

Incomplete information on Base64 encoding in Migration Guide #67

Closed mansiag closed 3 years ago

mansiag commented 3 years ago

Questions

Unable to find Json.toBase64() method mentioned in the migration guide

Use the following example code to convert a Base64URL to Base64 encoder.
String base64url = someJsonObject.getString("base64encodedElement")
String base64 = Json.toBase64(base64url);

https://vertx.io/docs/apidocs/io/vertx/core/json/Json.html

Version

Which version(s) did you encounter this bug ? 4.1.0

pmlopes commented 3 years ago

@mansiag I'll update the docs. We planned to introduce such a method but in the end it was discussed that this method could introduce confusion, so instead I'll document how to manually convert from base64url to base64 by adding the code:

base64urlString
  .replace('-', '+')
  .replace('_', '/');

As, this converts data between the 2 encoding formats.

mansiag commented 3 years ago

@pmlopes Can you please also provide more information on my second mail here on Decode - https://groups.google.com/g/vertx/c/JKcKfjE5wTo