Do you have any control over the sending javascript code? If so, then the obvious solution would be to calculate the hash
URI-encoding the data instead of after. If you're really going to be paranoid about making sure the data is transferred correctly, doing it that way would be better anyhow, since it would serve to validate that the data was encoded and decoded correctly, not only that it made it across the wire intact.