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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T18:36:45+00:00 2026-06-06T18:36:45+00:00

I tried the following code: import java.math.BigInteger; import org.apache.commons.codec.binary.Base32; import org.junit.Test; public class Sandbox

  • 0

I tried the following code:

import java.math.BigInteger;
import org.apache.commons.codec.binary.Base32;
import org.junit.Test;

public class Sandbox
{
  @Test
  public void testSomething() {
    String sInput = "GIYTINZUHAZTMNBX";

    BigInteger bb = new BigInteger(new Base32().decode(sInput));

    System.out.println("number = " + bb);
  }
}

and heres the output:

number = 237025977136523702055991

using this website to convert between base 32 I get a different result than the actual output. Heres the result I expect to see based on what I got from the website:

expected output = 2147483647

Any idea why this is happening?

Edit:

Forgive me for making it confusing by purposefully attempting to convert 2^31-1.

Using the conversion website I linked to earlier, I changed the input:

String sInput = "GE4DE===";

Expected output:

number = 182

Actual output:

number = 3225650
  • 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-06T18:36:46+00:00Added an answer on June 6, 2026 at 6:36 pm

    What you’re doing is correct… assuming that the Base32 string comes from Base32-encoding a byte array you get from calling BigInteger.toByteArray().

    BigInteger(byte[] val) does not really take an array of arbitrary bytes. It takes the byte[] representation of a BigInteger. Also, it assumes the most-significant byte is in val[0]).

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

Sidebar

Related Questions

I have the following code generated by Eclipse (.java file). import org.eclipse.swt.widgets.Shell; import org.eclipse.swt.widgets.Display;
Please have a look at the following code import java.awt.Color; import java.awt.Dimension; import java.awt.FlowLayout;
I'm trying to run the following code: import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; public class Reflection
I have the following simple code: import java.io.*; class IO { public static void
I am using the following code to extract a zip file in Java. import
I tried the java.io.Console API using eclipse. My sample code follows. package app; import
Looking for help with the following code... package pkgPeople; import java.io.File; import java.io.PrintWriter; import
I have tried the following code but has no effect: Imports system.Runtime.InteropServices <DllImport(UxTheme.DLL, BestFitMapping:=False,
I want to get script's origin filename in global functions. I tried following code,
I tried the following code tree. If I put the header file hello.h into

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.