The string encodes to slightly different values with the standard and URL base64 encoders (trailing = vs no padding) but they both decode to the original string as desired.
In F#, we use the System.Convert class for base64 encoding and decoding. The standard base64 encoding is straightforward, while the URL-safe version requires some additional string manipulation to replace characters and handle padding.
Note that F# uses exceptions for error handling, so we’ve wrapped the decoding operations in try-catch blocks to handle potential format errors.