Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8061481
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T10:21:12+00:00 2026-06-05T10:21:12+00:00

how to decode a base 64 encoded string encoded using Base64Encode with ATL_BASE64_FLAG_NOPAD flag.

  • 0

how to decode a base 64 encoded string encoded using Base64Encode with ATL_BASE64_FLAG_NOPAD flag.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T10:21:14+00:00Added an answer on June 5, 2026 at 10:21 am

    Assuming that just means “don’t put the = at the end” you can add the padding directly:

    public static string Base64PadEnd(string unpadded)
    {
        switch(unpadded.Length % 4)
        {
            case 0: return unpadded;
            case 2: return unpadded + "==";
            case 3: return unpadded + "=";
            default: throw new ArgumentException("Invalid unpadded base64");
        }
    }
    

    (The way base64 works, you should never end up with an unpadded value with a final block of 1 character.)

    After adding the padding, just use Convert.FromBase64String as usual.

    EDIT: As noted in comments, if your base64 string contains whitespace, you should remove that first before adding the padding. A simple text = Regex.Replace(text, @"\s", "") should do the trick.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have base 64 encoded string that looks something like this. cuVrcYvlqYze3OZ8Y5tSqQY205mcquu0GsHkgXe4bPg= I have
I'm thinking about using the encode/decode technique here (Encoding to base 36/decoding from base
I have some problem for decoding image data from base 64 encoded string. I
Ok, I have a string of text, encoded in Base64. I want to decode
Ok so I have a string of text, encoded in Base 64 like below:
I have one string which is base 32 bit decoded now I want to
Possible Duplicate: How to decode a JSON string in PHP? I would like to
Possible Duplicate: How to decode HTML entities using jQuery? I want to convert this
I need to encode/decode UTF-16 byte arrays to and from java.lang.String . The byte
Can we apply base 64 encoding in java and decode to get the same

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.