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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T05:58:12+00:00 2026-05-31T05:58:12+00:00

I noticed that zlib’s adler32 function does not always return the original seed when

  • 0

I noticed that zlib’s adler32 function does not always return the original seed when passed an empty string. For example:

adler32(0xFFFFFFFF,          // seed
        (const Bytef *) "",  // buffer
        0                    // length
       )

returns 0xE000E. I would think it should return 0xFFFFFFFF instead.

For most other values, it does return the original seed. However, for 1965855 numbers from 0 to 0xFFFFFFFF, adler32 changes the seed when the input string is empty.

Is this a bug or quirky behavior of the implementation, or is the range of the Adler-32 function in fact a subset of [0,0xFFFFFFFF] ?

Note that when the pointer is NULL, adler32 always returns 1 (the initial seed). This is documented behavior.

  • 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-31T05:58:13+00:00Added an answer on May 31, 2026 at 5:58 am

    The first argument is not a “seed”. It is the previous adler32 value that is being appended to.

    Yes, the range of adler32 is not all 32-bit values. 0xffffffff is not a valid adler32. The only valid adler32 values are those in which the upper and lower 16-bit halves of the 32-bit value are, when interpreted as integers, both less than 65521. When you call adler32() with a zero length, it will return the upper and lower halves modulo 65521.

    1965855 is 65521*15 + 15*65521 + 15*15, which is the number of 32-bit values with a valid upper half and invalid lower half, plus the number with an invalid upper half and a valid lower half, plus the number with both halves invalid.

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

Sidebar

Related Questions

I noticed that itertools does not (it seems to me) have a function capable
I noticed that i can set a return type on a function to 'Void'
I noticed that cherrypy session does not require a secret key configuration. On the
i noticed that paypal displays a very different favicon, one that's not just a
I noticed that calling the printf function (with cl_intel_printf extension), the same variable of
I noticed that the Left property for TTabSheet in the TPageControl is always 4.
I noticed that code after return from ExecuteRegisteredAsyncTasks call is executed in same thread
Noticed that if I want to read some data and if I do not
I noticed that the WPF designer does a very poor job on aligning the
After deploying my rails 3 app in production I noticed that paths are not

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.