-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

What does "writing the hash before calling the data" mean?

This also allows us to not have to allocate multiple copies of the
sha256 hash object. Its a minor improvisation that we won't bother
with, but it makes it easy to deal with it later. Also it means that
you don't have to dig through another layer of code to figure out what
hash function is getting called here. Makes it much more legible, no
hidden information.

Also what if a bug is found in sha256 tomorrow and we want to switch
to sha-3?

On 02/17/2014 12:18 AM, DavidVorick wrote:
> In src/common/hash.go:
> 
>> @@ -0,0 +1,43 @@ +package common + +import ( +	"crypto/rand" +
>> "hash" +	"math/big" +) + +func HashedRandomData(h hash.Hash,
>> length uint64) (hash string, data string) {
> 
> I don't think it's needed. We can leave it for now, but writing the
> hash before calling the data is extra work.
> 
> But more importantly, I think the spec is just going to be using a 
> single hash function throughout the code. I don't really see a
> reason to introduce multiple. If you can make a good argument for
> why we might end up using both sha256 AND some other hash in the
> project, I'll be convinced. But if the project as a whole just has
> 1 hash function, I don't see the point.
> 
> — Reply to this email directly or view it on GitHub 
> <https://github.com/Siacoin/Sia/pull/12/files#r9782472>.
> 

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.22 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQEcBAEBAgAGBQJTAZw/AAoJEHP1nN3uZoHu5ZoH/0wxQDTC4SgeK5BKSJqbFuQ8
OsBq3wD0lo8Rjz1E/Xsoy4BDbXkScFsGL0mAQ/XJKD6EvKdCfRRsNVkJmlbMYbke
/068D+AXmVz6lO29L41sVXEphoGJY+5ViE2PhZ4BzwftpWDxtORi8dLz+UZHrXvc
EW8WG5aDe5KctBpixK9YN+QMpaEQadzMBUWreso/jSzFGzee7eAUe0iCB4nvIFSL
Sll3QuHnfGAk+nyV20r0VxTLWOO5WpYWbYizXUu/r9YDBoTuI0rbaKGHE1Bc0FoG
AdF1fsNX3OmFK8QXrs6F0U+LC6uD698xSADr+2t/yCmtjidQt9Z7qjOYmjxr7U8=
=m4du
-----END PGP SIGNATURE-----