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 7949655
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T02:03:11+00:00 2026-06-04T02:03:11+00:00

I am implementing the SHA-2 algorithm in Java. However, I have run into a

  • 0

I am implementing the SHA-2 algorithm in Java. However, I have run into a problem. I need to append two hex values into one, but I am unable to do so. I tried appending the two as a string and using Long.parseLong(appendedString) but that causes a number format exception. Is there anyway I can do this in Java? If not is there anyway to do this in C and I’ll just implement it in C? Thanks for reading.

Here is the code:

    String temp = h[0] + "" + h[1]; //Where h[0] and h[1] are two hex values stored as Long
    //I also tried String temp = String.valueOf(h[0]) + String.valueOf(h[1]); but no dice
    Long appended = Long.parseLong(temp); //Number format exception here

When I say append I mean something like: 0x6a09e667 + 0xbb67ae85 = 0x6a09e667bb67ae85

  • 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-04T02:03:12+00:00Added an answer on June 4, 2026 at 2:03 am

    I’m assuming your code looks something like this:

    long hex1 = 0x6a09e667;
    long hex2 = 0xbb67ae85;
    

    and you want the output of 0x6a09e667bb67ae85.

    You can do this with some bit-shifting, such as the following:

    long result = hex2 | (hex1 << 32);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Im implementing users account in my website.I need to encrypt passwords from new members,however
Implementing the basic algorithm using last array as a pivot in Java, is it
When implementing Quicksort, one of the things you have to do is to choose
When implementing a client/server solutions, one of the questions you always need to answer
Im implementing a reminder app.There are two reminders (one for everyday and other for
Implementing a simple Login screen using JSF and Spring and Hibernate. I have written
When implementing the Strategy Pattern, where does one put the code that determines which
Implementing the very first scala example I ran into some problems probably tipical for
Implementing a low pass FIR filter, when should one use FFT and IFFT instead
Implementing Document-View pattern I faced the problem: standard generic collections and dictionaries ( List<T>

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.