Around 6th Century BC, the Persian empire had a very nifty way of counting battle casualties. Before any battles, the soldiers would be lined up in the presence of their battle commanders and generals. In front of them, a basket. With the emperor as the witness, they’d throw a single arrow from their quiver into the basket, which would then be sealed.
When the soldiers return, they’d be commanded to take an arrow from the same basket. The remaining arrows would then give the empire an estimate of the men they have lost in the battle. This is akin to the digital checksum process we use to verify the integrity of a file that’s transmitted over the internet.