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

  • SEARCH
  • Home
  • 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 4079320
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T17:47:12+00:00 2026-05-20T17:47:12+00:00

I have one function that returns me String : public String getString(String password){ ……

  • 0

I have one function that returns me String :

public String getString(String password){

          ......

    try {
    .......
        encodedPassword =  Base64.encodeToString(msgDigest,1 );

    } catch (UnsupportedEncodingException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    } catch (NoSuchAlgorithmException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    }

    return encodedPassword;

    }

I want to add (concatenate) “=” String to returning string from function

I try using this:

encrptdPassword = getString("1234");
encrptdPassword = encrptdPassword+"=";

Or:

encrptdPassword = encrptdPassword .concat("=");

but I get result like two different objects (space or brake between)

I think problem is in Base64.encodeToString , but I must use 64 based string


Function getString returns me:

A6xnQhbz4Vx2HuGl4lXwZ5U2I8iziLRFnhP5eNfIRvQ

I want to add = to the returning string as:

A6xnQhbz4Vx2HuGl4lXwZ5U2I8iziLRFnhP5eNfIRvQ=

but I receive this on output

A6xnQhbz4Vx2HuGl4lXwZ5U2I8iziLRFnhP5eNfIRvQ = 

Or:

A6xnQhbz4Vx2HuGl4lXwZ5U2I8iziLRFnhP5eNfIRvQ
=

…like 2 different strings.

Where I’m wrong?

  • 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-05-20T17:47:12+00:00Added an answer on May 20, 2026 at 5:47 pm

    Isn’t the 1 in Base64.encodeToString(msgDigest,1 ) padding?

    If it’s not, then you could just trim() the string to remove the whitespace.

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

Sidebar

Related Questions

I have one function ParseHtmlTable(string htmlContent) . Now in that function I want to
I have one javascript function that used to display the menu and content in
I have a function that performs a monthly task on one or more specified
I have one method that opens a file and passes off to another function
I have this function that switches the HTML contents from one element on a
I have a function that, when the user selects one or more items, it
I have the following function that is supposed to trigger anytime one of the
I have one array. I want that array to retain its value between function
I have a win form that creates a site in IIS7. One function needs
So I am baffled by this one. I have a function that is responsible

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.