Greg Stein wrote: >On Mon, Nov 12, 2001 at 10:02:43AM -0800, Brian Pane wrote: > >>... >>By the way, I have an alternate implementation of a >>table speedup that I wrote late yesterday. It caches >>a 32-bit checksum for each key in the table and compares >>checksums to decide whether it can skip the strcasecmp. >>It's still O(n), but the idea is to reduce the constant >>multiplier. (The checksum computation basically just >>packs the first four bytes of the string into an int and >>does some bit masking to normalize to all-uppercase. >> > >The bit masking won't work on EBCDIC machines. >
It looks like EBCDIC lowercase letters and their capital counterparts are offset by 64. While we can't use the same mask value as for ASCII (where the offset is 32), the fact that there's a power-of-two difference for EBCDIC should enable us to use the bit masking technique, right? --Brian
