Open satra opened 7 years ago
interesting indeed.. you could help me out though -- see issue 52 there (ashamed to make a backlink here ;) )
here is a small snippet of multihash code.
def compute_hash(url):
try:
response = urllib.request.urlopen(url[1].atLocation)
filedata = response.read()
except urllib.error.HTTPError:
return pd.DataFrame({'multihash': [pd.np.nan]}, index=[url[0]])
encoded = multihash.encode(filedata, multihash.SHA2_256)
return pd.DataFrame({'multihash': [''.join(format(x, '02x') for x in encoded)]}, index=[url[0]])
i've been reading up on a few things around ipfs and this looks like interesting:
https://github.com/multiformats/multihash