Hash aware input format

I've added a more or less comprehensive test. There are some other conditions I will add (unexpected boundary key lengths, overflow from Byte.MAX_VALUE) as well as the ability to specify an entity id rather than just giving the desired prefix bytes.

Don't merge this, obv.