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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T16:36:40+00:00 2026-05-23T16:36:40+00:00

I’ve been stuck on this for a few days now and can’t seem to

  • 0

I’ve been stuck on this for a few days now and can’t seem to get it. I’m hoping that by posting here, I’ll have an epiphany and fix this issue 30 seconds after posting! 😀
Here goes….

I need to encrypt a string, append it to my URL, and send it to the server. The steps are as follows:

1. Build the string (for this post, I'm using a constant TEST string)
2. Get a CRC of the string and add that to the front of the string.
3. HEX the whole string.
4. Append to URL and connect over HTTP

I’m stuck on 2!! The CRC that I SHOULD be getting is 1903129755, but among other results, I’m getting -1903129756. NOTE: For purposes of this post, I’m using a test string and its resulting CRC. The string will change as I include the time in milliseconds when building it.

I should point out also, this is on blackberry. The android code works perfect. That CRC is taken from both the Android and an online CRC generator website:
http://hash.online-convert.com/crc32b-generator

The code I have seems to work for others, so I’m obviously at fault here. Can someone spot my error?? Thanks

As you can see, I’ve tried a few different ways:

    import net.rim.device.api.util.CRC32;

    public long getCrcValue(String inputText)
    {
            int crc1 = 0,crc2=0;
            long crc3=0;

            crc1 = CRC32.update(CRC32.INITIAL_VALUE, inputText.getBytes());
            crc2 = CRC32.update(0, inputText.getBytes());
            String temp = Integer.toBinaryString(crc1);
            crc3 = Long.parseLong(temp,2);
            long crc4 = CRC32.update(CRC32.INITIAL_VALUE, inputText.getBytes());
            long crc5 = CRC32.update(0, inputText.getBytes());


            logger.log("CRC1 is: "+crc1);
            logger.log("CRC2 is: "+crc2);
            logger.log("CRC3 is: "+crc3);
            logger.log("CRC4 is: "+crc4);
            logger.log("CRC5 is: "+crc5);

return crc1;
}

PS logger is my own class to output customised formatted outputs to the console, so ignore it.

EDIT: Speaking of outputs, here’s what the output is:

CRC1 is: -1903129756
CRC2 is: -460833676
CRC3 is: 2391837540
CRC4 is: -1903129756
CRC5 is: -460833676

EDIT2: Here’s the equivalent Android code.
Note crc is defined as CRC32 crc:

public long getCrcValue(String inputText)
{
    crc.reset();
    crc.update(inputText.getBytes());
    return crc.getValue();
}
  • 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-23T16:36:41+00:00Added an answer on May 23, 2026 at 4:36 pm

    FYI,
    Eventually I fixed this by taking the source from java.util.zip.CRC32 and java.util.zip.checksum and creating new classes in my blackberry project using that source. Since thats the same implementation that Android uses, both apps work fine!

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

Sidebar

Related Questions

I have a jquery bug and I've been looking for hours now, I can't
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
this is what i have right now Drawing an RSS feed into the php,
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I have this code to decode numeric html entities to the UTF8 equivalent character.
I have a French site that I want to parse, but am running into
This could be a duplicate question, but I have no idea what search terms
I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString
I know there's a lot of other questions out there that deal with this
Does anyone know how can I replace this 2 symbol below from the string

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.