Opened 4 weeks ago

Closed 2 weeks ago

Last modified 2 weeks ago

#70705 closed defect (fixed)

libghash: checksum mismatch

Reported by: barracuda156 Owned by: ryandesign (Ryan Carsten Schmidt)
Priority: Normal Milestone:
Component: ports Version: 2.10.1
Keywords: Cc:
Port: libghash

Description

--->  Fetching distfiles for libghash
--->  GeneralHashFunctions_-_C.zip does not exist in /opt/local/var/macports/distfiles/libghash/0.0.2_1
--->  Attempting to fetch GeneralHashFunctions_-_C.zip from http://www.partow.net/downloads/
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  3137  100  3137    0     0   5921      0 --:--:-- --:--:-- --:--:--  5918
--->  Verifying checksums for libghash
--->  Checksumming GeneralHashFunctions_-_C.zip
Error: Checksum (rmd160) mismatch for GeneralHashFunctions_-_C.zip
Portfile checksum: GeneralHashFunctions_-_C.zip rmd160 c13ce6f0de3970b81dfffa989920c37a7cc5f410
Distfile checksum: GeneralHashFunctions_-_C.zip rmd160 0b717a6e9d35a710847c1ff41bfa7f8952ef250a
Error: Checksum (sha256) mismatch for GeneralHashFunctions_-_C.zip
Portfile checksum: GeneralHashFunctions_-_C.zip sha256 b352eda5d2660bfc4afc11918b577925d0d62fd39dcf6310be9bdb63d08b78c3
Distfile checksum: GeneralHashFunctions_-_C.zip sha256 2879f02a169e9494a4111bc6e2f00412d5dd3b919f8f6ac2b2eb5b3180e12c07
The correct checksum line may be:
checksums           rmd160  0b717a6e9d35a710847c1ff41bfa7f8952ef250a \
                    sha256  2879f02a169e9494a4111bc6e2f00412d5dd3b919f8f6ac2b2eb5b3180e12c07 \
                    size    3137
Error: Failed to checksum libghash: Unable to verify file checksums

Change History (3)

comment:1 Changed 2 weeks ago by ryandesign (Ryan Carsten Schmidt)

This project uses an unversioned distfile so it is normal for a checksum mismatch to occur when they update to a new version. The new version is still identified as 0.0.2 so this will be the second stealth update of that version (that we have noticed). The distfile and its contents appear to have had their modification dates artificially backdated to January 1, 2000, so I don't know when these versions were actually released.

The difference between the old and new 0.0.2 is:

  • GeneralHashFunctions_-_C/GeneralHashFunctions.c

    diff -ru 1/GeneralHashFunctions_-_C/GeneralHashFunctions.c 2/GeneralHashFunctions_-_C/GeneralHashFunctions.c
    1 2  
     1/*
     2 **************************************************************************
     3 *                                                                        *
     4 *          General Purpose Hash Function Algorithms Library              *
     5 *                                                                        *
     6 * Author: Arash Partow - 2002                                            *
     7 * URL: http://www.partow.net                                             *
     8 * URL: http://www.partow.net/programming/hashfunctions/index.html        *
     9 *                                                                        *
     10 * Copyright notice:                                                      *
     11 * Free use of the General Purpose Hash Function Algorithms Library is    *
     12 * permitted under the guidelines and in accordance with the MIT License. *
     13 * http://www.opensource.org/licenses/MIT                                 *
     14 *                                                                        *
     15 **************************************************************************
     16*/
     17
     18
    119#include "GeneralHashFunctions.h"
    220
    3 unsigned int RSHash(char* str, unsigned int len)
     21
     22unsigned int RSHash(const char* str, unsigned int len)
    423{
    524   unsigned int b    = 378551;
    625   unsigned int a    = 63689;
     
    1837/* End Of RS Hash Function */
    1938
    2039
    21 unsigned int JSHash(char* str, unsigned int len)
     40unsigned int JSHash(const char* str, unsigned int len)
    2241{
    2342   unsigned int hash = 1315423911;
    2443   unsigned int i    = 0;
     
    3352/* End Of JS Hash Function */
    3453
    3554
    36 unsigned int PJWHash(char* str, unsigned int len)
     55unsigned int PJWHash(const char* str, unsigned int len)
    3756{
    3857   const unsigned int BitsInUnsignedInt = (unsigned int)(sizeof(unsigned int) * 8);
    3958   const unsigned int ThreeQuarters     = (unsigned int)((BitsInUnsignedInt  * 3) / 4);
     
    5877/* End Of  P. J. Weinberger Hash Function */
    5978
    6079
    61 unsigned int ELFHash(char* str, unsigned int len)
     80unsigned int ELFHash(const char* str, unsigned int len)
    6281{
    6382   unsigned int hash = 0;
    6483   unsigned int x    = 0;
     
    7998/* End Of ELF Hash Function */
    8099
    81100
    82 unsigned int BKDRHash(char* str, unsigned int len)
     101unsigned int BKDRHash(const char* str, unsigned int len)
    83102{
    84103   unsigned int seed = 131; /* 31 131 1313 13131 131313 etc.. */
    85104   unsigned int hash = 0;
     
    95114/* End Of BKDR Hash Function */
    96115
    97116
    98 unsigned int SDBMHash(char* str, unsigned int len)
     117unsigned int SDBMHash(const char* str, unsigned int len)
    99118{
    100119   unsigned int hash = 0;
    101120   unsigned int i    = 0;
     
    110129/* End Of SDBM Hash Function */
    111130
    112131
    113 unsigned int DJBHash(char* str, unsigned int len)
     132unsigned int DJBHash(const char* str, unsigned int len)
    114133{
    115134   unsigned int hash = 5381;
    116135   unsigned int i    = 0;
     
    125144/* End Of DJB Hash Function */
    126145
    127146
    128 unsigned int DEKHash(char* str, unsigned int len)
     147unsigned int DEKHash(const char* str, unsigned int len)
    129148{
    130149   unsigned int hash = len;
    131150   unsigned int i    = 0;
     
    139158/* End Of DEK Hash Function */
    140159
    141160
    142 unsigned int BPHash(char* str, unsigned int len)
     161unsigned int BPHash(const char* str, unsigned int len)
    143162{
    144163   unsigned int hash = 0;
    145164   unsigned int i    = 0;
     
    153172/* End Of BP Hash Function */
    154173
    155174
    156 unsigned int FNVHash(char* str, unsigned int len)
     175unsigned int FNVHash(const char* str, unsigned int len)
    157176{
    158177   const unsigned int fnv_prime = 0x811C9DC5;
    159178   unsigned int hash      = 0;
     
    170189/* End Of FNV Hash Function */
    171190
    172191
    173 unsigned int APHash(char* str, unsigned int len)
     192unsigned int APHash(const char* str, unsigned int len)
    174193{
    175194   unsigned int hash = 0xAAAAAAAA;
    176195   unsigned int i    = 0;
  • GeneralHashFunctions_-_C/GeneralHashFunctions.h

    diff -ru 1/GeneralHashFunctions_-_C/GeneralHashFunctions.h 2/GeneralHashFunctions_-_C/GeneralHashFunctions.h
    1 2  
    99 *                                                                        *
    1010 * Copyright notice:                                                      *
    1111 * Free use of the General Purpose Hash Function Algorithms Library is    *
    12  * permitted under the guidelines and in accordance with the most current *
    13  * version of the Common Public License.                                  *
    14  * http://www.opensource.org/licenses/cpl1.0.php                          *
     12 * permitted under the guidelines and in accordance with the MIT License. *
     13 * http://www.opensource.org/licenses/MIT                                 *
    1514 *                                                                        *
    1615 **************************************************************************
    1716*/
    1817
    1918
    20 
    2119#ifndef INCLUDE_GENERALHASHFUNCTION_C_H
    2220#define INCLUDE_GENERALHASHFUNCTION_C_H
    2321
     
    2826typedef unsigned int (*hash_function)(char*, unsigned int len);
    2927
    3028
    31 unsigned int RSHash  (char* str, unsigned int len);
    32 unsigned int JSHash  (char* str, unsigned int len);
    33 unsigned int PJWHash (char* str, unsigned int len);
    34 unsigned int ELFHash (char* str, unsigned int len);
    35 unsigned int BKDRHash(char* str, unsigned int len);
    36 unsigned int SDBMHash(char* str, unsigned int len);
    37 unsigned int DJBHash (char* str, unsigned int len);
    38 unsigned int DEKHash (char* str, unsigned int len);
    39 unsigned int BPHash  (char* str, unsigned int len);
    40 unsigned int FNVHash (char* str, unsigned int len);
    41 unsigned int APHash  (char* str, unsigned int len);
     29unsigned int RSHash  (const char* str, unsigned int len);
     30unsigned int JSHash  (const char* str, unsigned int len);
     31unsigned int PJWHash (const char* str, unsigned int len);
     32unsigned int ELFHash (const char* str, unsigned int len);
     33unsigned int BKDRHash(const char* str, unsigned int len);
     34unsigned int SDBMHash(const char* str, unsigned int len);
     35unsigned int DJBHash (const char* str, unsigned int len);
     36unsigned int DEKHash (const char* str, unsigned int len);
     37unsigned int BPHash  (const char* str, unsigned int len);
     38unsigned int FNVHash (const char* str, unsigned int len);
     39unsigned int APHash  (const char* str, unsigned int len);
    4240
    4341
    4442#endif
  • GeneralHashFunctions_-_C/HashTest.c

    diff -ru 1/GeneralHashFunctions_-_C/HashTest.c 2/GeneralHashFunctions_-_C/HashTest.c
    1 2  
    99 *                                                                        *
    1010 * Copyright notice:                                                      *
    1111 * Free use of the General Purpose Hash Function Algorithms Library is    *
    12  * permitted under the guidelines and in accordance with the most current *
    13  * version of the Common Public License.                                  *
    14  * http://www.opensource.org/licenses/cpl1.0.php                          *
     12 * permitted under the guidelines and in accordance with the MIT License. *
     13 * http://www.opensource.org/licenses/MIT                                 *
    1514 *                                                                        *
    1615 **************************************************************************
    1716*/
    1817
    1918
    20 
    2119#include <stdio.h>
    2220#include <stdlib.h>
     21
    2322#include "GeneralHashFunctions.h"
    2423
    2524
    2625int main(int argc, char* argv[])
    2726{
    28 
    2927   char* key = "abcdefghijklmnopqrstuvwxyz1234567890";
    3028
    3129   printf("General Purpose Hash Function Algorithms Test\n");
    32    printf("By Arash Partow - 2002         \n");
    33    printf("Key:                         %s\n",key);
    34    printf(" 1. RS-Hash Function Value:   %u\n",RSHash(key,36));
    35    printf(" 2. JS-Hash Function Value:   %u\n",JSHash(key,36));
    36    printf(" 3. PJW-Hash Function Value:  %u\n",PJWHash(key,36));
    37    printf(" 4. ELF-Hash Function Value:  %u\n",ELFHash(key,36));
     30   printf("By Arash Partow - 2002          \n"                 );
     31   printf("Key:                          %s\n",key             );
     32   printf(" 1. RS-Hash Function Value:   %u\n",RSHash  (key,36));
     33   printf(" 2. JS-Hash Function Value:   %u\n",JSHash  (key,36));
     34   printf(" 3. PJW-Hash Function Value:  %u\n",PJWHash (key,36));
     35   printf(" 4. ELF-Hash Function Value:  %u\n",ELFHash (key,36));
    3836   printf(" 5. BKDR-Hash Function Value: %u\n",BKDRHash(key,36));
    3937   printf(" 6. SDBM-Hash Function Value: %u\n",SDBMHash(key,36));
    40    printf(" 7. DJB-Hash Function Value:  %u\n",DJBHash(key,36));
    41    printf(" 8. DEK-Hash Function Value:  %u\n",DEKHash(key,36));
    42    printf(" 9. BP-Hash Function Value:   %u\n",BPHash(key,36));
    43    printf("10. FNV-Hash Function Value:  %u\n",FNVHash(key,36));
    44    printf("11. AP-Hash Function Value:   %u\n",APHash(key,36));
     38   printf(" 7. DJB-Hash Function Value:  %u\n",DJBHash (key,36));
     39   printf(" 8. DEK-Hash Function Value:  %u\n",DEKHash (key,36));
     40   printf(" 9. BP-Hash Function Value:   %u\n",BPHash  (key,36));
     41   printf("10. FNV-Hash Function Value:  %u\n",FNVHash (key,36));
     42   printf("11. AP-Hash Function Value:   %u\n",APHash  (key,36));
    4543
    46    exit(EXIT_SUCCESS);
    4744   return 1;
    48 
    4945}
  • GeneralHashFunctions_-_C/Makefile

    diff -ru 1/GeneralHashFunctions_-_C/Makefile 2/GeneralHashFunctions_-_C/Makefile
    1 2  
    11#
    2 # General Hash Function Algorithms Master MakeFile
     2# General Hash Function Algorithms
    33# By Arash Partow - 2000
    44#
    55# URL: http://www.partow.net/programming/hashfunctions/index.html
    66#
    77# Copyright Notice:
    88# Free use of this library is permitted under the
    9 # guidelines and in accordance with the most
    10 # current version of the Common Public License.
    11 # http://www.opensource.org/licenses/cpl1.0.php
     9# guidelines and in accordance with the MIT License.
     10# http://www.opensource.org/licenses/MIT
    1211#
    1312
     13
    1414COMPILER      = -cc
    1515OPTIONS       = -std=c99 -pedantic -Wall -o
    1616OPTIONS_LIBS  = -std=c99 -pedantic -Wall -c

The license has changed from CPL-1 to MIT.

The test suite for the new 0.0.2 fails. The test suite for the old 0.0.2 succeeds.

Last edited 2 weeks ago by ryandesign (Ryan Carsten Schmidt) (previous) (diff)

comment:2 Changed 2 weeks ago by ryandesign (Ryan Carsten Schmidt)

The test results are the same for both versions but in @2.0.1_2 exit(EXIT_SUCCESS); has simply been removed from the end of the test program so it will always exit with a failing status code, whereas before it would always end with a successful status code. Not much of a test…

Version 0, edited 2 weeks ago by ryandesign (Ryan Carsten Schmidt) (next)

comment:3 Changed 2 weeks ago by ryandesign (Ryan Carsten Schmidt)

Owner: set to ryandesign
Resolution: fixed
Status: newclosed

In 8f6d558fe5c96f8c406223e050201c55d07c7fef/macports-ports (master):

libghash: Update to the new version of 0.0.2

Closes: #70705

Note: See TracTickets for help on using tickets.