ipfs / ipfs/kubo

Extending the api for hashing file(s) from multihash without data transfers.

Open
#4,420 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
17.1k
Forks
3.2k
Avg merge
3d 18h
Merged PRs (30d)
11

Description

#### Version information:
go-ipfs version: 0.4.13-
Repo version: 6
System version: amd64/linux
Golang version: go1.9.2

#### Type: Enhancement

#### Description:
For my project I need to get a hash (using sha256) of files stored on ipfs. I also need a salted hash (for signature purpose).
So far, what I do, using the python api is looks like this (simplified for readability, my real code gets the files and reads it by blocks of 64k to be more memory efficient).
`api = ipfsapi.connect(host=host, port=port)`
`data = api.cat(multihash)`
`vote = hashlib.sha256( data).hexdigest()`
`sign = hashlib.sha256(salt+data).hexdigest()`

my issue is that I have to get the file, whether it is by using `api.get` or `api.cat`, which cost bandwidth. How complicated would it be to implement something like `ipfsapi.sha256(multihash, salt=b'')` that computes the hash (with potential salt) remotely and avoid huge data exchanges ?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.