Speaking of mlbr, would you mind clarifying the licence? The closest
thing I can find (aside from miniz.h and uncrunch.c) is that "This is
an open source non-commercial project".
Also, what do you consider the licence to be on the original lzhuf.c?
I went to some effort to clarify this before adapting it for lbrate,
and I'd be interested in your perspective.
Finally, I found the most curious thing. This code from mlbr's
uncrunch.c (which I'm assuming it's reasonable to post in order to
comment on it):
if (pred == IMPRED && chr == 0) {
hashval = 0x800; /* special case (leaving the zero code free for EOF) */
} else {
/* normally we do a slightly awkward mid-square thing */
uint16_t a = (((pred + chr) | 0x800) & 0x1fff);
uint16_t b = (a >> 1);
hashval = (((b * (b + (a & 1))) >> 4) & 0xfff);
}
...seems to have remarkably similar comments to this code I wrote in
2001 for lbrate's readlzw.c:
if(oldcode==0xffff && chr==0)
hashval=0x800; /* special case (leaving the zero code free for EOF) */
else
{
/* normally we do a slightly awkward mid-square thing */
a=(((oldcode+chr)|0x800)&0x1fff);
b=(a>>1);
hashval=(((b*(b+(a&1)))>>4)&0xfff);
}
I also notice that most of an older version's "slightly odd approach"
comment at line 109 here:
https://github.com/ogdenpm/mlbr/blob/35cf3093a4e7b39c70383c1b085391ca7cc62aec/uncrunch.c
...was in lbrate many years earlier, with the same "If" typo.
So I'd be interested in your thoughts on this as well.
-Rus.