dgl.data.utils.check_sha1

dgl.data.utils.check_sha1(filename, sha1_hash)[source]

Check whether the sha1 hash of the file content matches the expected hash.

Codes borrowed from mxnet/gluon/utils.py

Parameters:
  • filename (str) – Path to the file.
  • sha1_hash (str) – Expected sha1 hash in hexadecimal digits.
Returns:

Whether the file content matches the expected hash.

Return type:

bool