Access to a previous block's hash

Is there a way to refer to the hash of a previous block? I have looked
at the TxInfo documentation and it has a field txInfoId :: TxId with “Hash of the pending transaction (excluding witnesses)” but that doesn’t quite sound like what I’m after.

To avoid an XY problem, my goal with using a previous block’s hash would be as a source of randomness, with the idea being that it won’t be worth it for miners to re-mine, let’s say, 100 blocks just to influence this one contract’s behaviour.