I was under the impression that the hash function, specifically SHA256 for my interest, can be used on any length input to create a “digest” or hashed function. By that I am thinking of the example of submitting a document to the hash function and getting a “digest” (right word?) that can be used to verity that the document has not been changed. But that explanation specifically states less than 264 bits.
Please set me straight.
The limit of 2^64 bits is basically a theoretical limit rather than a practical one. 2^64 bits is 2.3 exabytes which is way larger than a file would ever practically be.
This limit comes from the padding method used by SHA256. This padding adds a single bit, and then the length of the message in bits plus that added "1". This length is stored in a fixed width integer. For SHA256, it's 64 bits. Thus the message must not be larger than 2^64-1 bits as otherwise it will overflow the maximum of a 64 bit integer.