Allow read-only hash operations to accept HashTop.

Closes PR13710.