Update hash method

This commit is contained in:
Zeva Rose 2022-02-09 17:49:52 -07:00
parent 0e627eae72
commit 1139c406fb
2 changed files with 3 additions and 2 deletions

View file

@ -48,8 +48,9 @@ async def hash(
Hash an object.
Args:
hash_func: Hash function, default `hashlib.sha256`
data: URL or text to hash
method: Hash function/function name, default `hashlib.sha256`
size: Blocksize, default `8 MB`
Returns:
Tuple of hash hex, data size, and content type

View file

@ -24,4 +24,4 @@ async def get_size(link: str) -> int:
async with ClientSession() as session:
resp = await session.get(link)
resp.raise_for_status()
return resp.content_length
return resp.content_length or -1