Forensic Investigation - Code Example

In this module, we are using hashlib library to compare two files. But my question is we can do that using RE then why hashlib, am I missing something additional here?