Dave Angel wrote: [clever analysis snipped] > I'd use digest() instead of hexdigest(), and of course reduce the > subscript to 63 or less. OP: You could also try hash(line) % 4 While AFAIK it doesn't make promises about randomness it might still be good enough in practice. Peter