Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <51c2b4f4a39d267f5c67b7728de63cc3@smtp.hushmail.com>
Date: Mon, 10 Jun 2013 00:51:29 +0200
From: magnum <john.magnum@...hmail.com>
To: john-dev@...ts.openwall.com
Subject: Re: popular binary_hash_*

On 9 Jun, 2013, at 23:50 , Lukas Odzioba <lukas.odzioba@...il.com> wrote:
> magnum,all:
> what do you think about moving this common piece of code to formats.c?
> 
> static int binary_hash_1(void * binary) { return *(ARCH_WORD_32 *)
> binary & 0xFF; }
> static int binary_hash_2(void * binary) { return *(ARCH_WORD_32 *)
> binary & 0xFFF; }
> static int binary_hash_3(void * binary) { return *(ARCH_WORD_32 *)
> binary & 0xFFFF; }
> static int binary_hash_4(void * binary) { return *(ARCH_WORD_32 *)
> binary & 0xFFFFF; }
> static int binary_hash_5(void * binary) { return *(ARCH_WORD_32 *)
> binary & 0xFFFFFF; }
> static int binary_hash_6(void * binary) { return *(ARCH_WORD_32 *)
> binary & 0x7FFFFFF; }
> 
> We have near 100 occurences of that in bleeding = 6*100-6 = 594
> duplicated lines.

Sure, please do. There's actually seven of them, so 693 lines.

magnum

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.