Fix ShaCalculator handling of mixed-case keys.

This was sorting the keys before upcasing them, which would result in them being used in the wrong order.