www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 14777] New: 0 is not the initial value for std.zlib.adler32

https://issues.dlang.org/show_bug.cgi?id=14777

          Issue ID: 14777
           Summary: 0 is not the initial value for std.zlib.adler32
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P1
         Component: phobos
          Assignee: nobody puremagic.com
          Reporter: michalg89 gmail.com

0 is not the initial value for std.zlib.adler32 as stated in the documentation
(https://github.com/D-Programming-Language/phobos/blob/master/std/zlib.d#L67).
According to zlib docs the initial value should be computed by calling adler32
with null pointer: https://github.com/madler/zlib/blob/master/zlib.h#L1572.
Quick look at the source of zlib revelas the true initial value: 1
(https://github.com/madler/zlib/blob/master/adler32.c#L88)

--
Jul 06 2015