Live data from Hacker News

Hashpipe – Pipe iff the hash matches

jbenet.github.io

41–50 of 90 posts

Re: Hashpipe – Pipe iff the hash matches

#41
post #29

Earlier quoted context omitted.

When the just-over-the-next-hilltop promised-land nirvana of content-centric networking arrives, the hash will be enough to locate & download the content – so you shouldn't even need an URL: $ hashcurl QmUJPTFZnR2CPGAzmfdYPghgrFtYFB6pf1BqMvqfiPDam8 | sh Maybe it's even a special filesystem path, that contains (but does not list) everything-that's-nameable-and-findable: $ sh /everything/QmUJPTFZnR2CPGAzmfdYPghgrFtYFB6…

this already works. install ipfs: http://ipfs.io/docs/install then: ipfs init ipfs daemon & sleep 20 # sorry this will go away ipfs mount sh /ipfs/QmTpnQL97XEHmyt54mgEwf5BN8gJWvw4sGgwQzjqtBwLX6 you can see it on the web at: http://gateway.ipfs.io/ipfs/QmTpnQL97XEHmyt54mgEwf5BN8gJWvw4...

That's great! I hope that IPFS, or something of its ilk, can be the promised-land to which I alluded.

If I were to install it, how hard/breaking would it be to change the access-path to something more grandiosely descriptive like '/everything/'?

Re: Hashpipe – Pipe iff the hash matches

#42
post #7

Earlier quoted context omitted.

Loading everything into memory at once shouldn't be necessary to produce a hash of the entire input. All of the hash functions currently supported allow for incremental hashing. That means you can hash in blocks instead of all at once.

The input still needs to be cached for eventual output in case the hash matches I assume.

In that case, you could still cache if you want but at least you now have the option to manage your memory instead of always crashing with large input

Re: Hashpipe – Pipe iff the hash matches

#43
post #7

Earlier quoted context omitted.

Loading everything into memory at once shouldn't be necessary to produce a hash of the entire input. All of the hash functions currently supported allow for incremental hashing. That means you can hash in blocks instead of all at once.

The input still needs to be cached for eventual output in case the hash matches I assume.

More importantly, so nothing is output if the hash doesn't match.

Re: Hashpipe – Pipe iff the hash matches

#45
Getting this in before the gratuitous negativity brigade starts hammering down:

This an implementation of a stupid joke looking for a problem. If someone actually needed this in their toolbelt they could use perl or even (amazingly) bash to handle this problem.

I would personally not name anything I worked on after a song from one of Weezer's shittiest albums, but that's just me.

Re: Hashpipe – Pipe iff the hash matches

#46
If the code url and hash are provided at the same place, why wouldn't an attacker just MitM that and switch them both? What does this add?

Also anyone who is not serving code over https should fix that immediately.

Re: Hashpipe – Pipe iff the hash matches

#48
post #41

Earlier quoted context omitted.

this already works. install ipfs: http://ipfs.io/docs/install then: ipfs init ipfs daemon & sleep 20 # sorry this will go away ipfs mount sh /ipfs/QmTpnQL97XEHmyt54mgEwf5BN8gJWvw4sGgwQzjqtBwLX6 you can see it on the web at: http://gateway.ipfs.io/ipfs/QmTpnQL97XEHmyt54mgEwf5BN8gJWvw4...

That's great! I hope that IPFS, or something of its ilk, can be the promised-land to which I alluded. If I were to install it, how hard/breaking would it be to change the access-path to something more grandiosely descriptive like '/everything/'?

its a simple matter of changing the ipfs config file

Re: Hashpipe – Pipe iff the hash matches

#49
post #29

Earlier quoted context omitted.

When the just-over-the-next-hilltop promised-land nirvana of content-centric networking arrives, the hash will be enough to locate & download the content – so you shouldn't even need an URL: $ hashcurl QmUJPTFZnR2CPGAzmfdYPghgrFtYFB6pf1BqMvqfiPDam8 | sh Maybe it's even a special filesystem path, that contains (but does not list) everything-that's-nameable-and-findable: $ sh /everything/QmUJPTFZnR2CPGAzmfdYPghgrFtYFB6…

I'm not sure if it's really great or a really terrible, but I love the "/everything" idea.

you should check out ipfs.io then :)

Disclaimer: I'm one of the devs

Re: Hashpipe – Pipe iff the hash matches

#50
You might want to `set -o pipefail` on your bash because a failing process does not stop things from getting piped:

`echo OK | false | echo OK2` --> this command returns zero exit code even though false does return non-zero exit code. If you do `set -o pipefail` entire pipe will fail with non-zero exit code (of `false`).

Post reply on HN