These are chat archives for Nethereum/Nethereum

13th
May 2016
rickzanux
@rickzanux
May 13 2016 13:49
I have a (small) problem, sure my fault. want to store hash in a contract, so I compute an hash with function
Nethereum.ABI.Util.Sha3Keccack cryptoFunction = new Nethereum.ABI.Util.Sha3Keccack();
var fullHashField = cryptoFunction.CalculateHash(aString);
Juan Blanco
@juanfranblanco
May 13 2016 13:50
k
rickzanux
@rickzanux
May 13 2016 13:50
but the result is 64bytes! so when I try to store this field in a contract with "hash byte32" of course it is telling me that the fileds is to little....
"bytes32 hash"
Juan Blanco
@juanfranblanco
May 13 2016 13:51
put it a byte array
in a byte array
rickzanux
@rickzanux
May 13 2016 13:52
ok. is it right compute an hash in this way?
or better i find a function tocumpte a 32 bytes hash?
Juan Blanco
@juanfranblanco
May 13 2016 13:52
well that is the other option
rickzanux
@rickzanux
May 13 2016 13:53
the hash can be computed woith any hash function, the mportant things is to validfdate it I will use the same hash function
Juan Blanco
@juanfranblanco
May 13 2016 13:54
use md5
rickzanux
@rickzanux
May 13 2016 13:55
better use a 32bits hash. save a lot of gas
ok
Juan Blanco
@juanfranblanco
May 13 2016 13:55
yes that is a very good thought
saving gas is important
UX
rickzanux
@rickzanux
May 13 2016 13:56
yes. is some reddit say that stoarge cost 31k eth/GB
Juan Blanco
@juanfranblanco
May 13 2016 13:57
maybe md5 is not good as is not collision resistant
rickzanux
@rickzanux
May 13 2016 13:59
??
Juan Blanco
@juanfranblanco
May 13 2016 14:00
there is a probability that 2 hashes will be the same
are you going to put some salt and pepper?
and custom ones?
rickzanux
@rickzanux
May 13 2016 14:03
salt and pepper?
rickzanux
@rickzanux
May 13 2016 14:04
This message was deleted
just you to know: i built a system that stored data with a contract on ethereum built with a queue and asyncs task, so you can call it as webervices with the data you want (no fized format) and forget it. the system hash the data ,scal ltrnasxction to store on ethereum and sotre the result of data in NoSQL database where you can read wehn you want. if you want you can leave on my NoSQL database and just acces when you need it. so stroing data oon ethereum is only a call to a web ervice away
Juan Blanco
@juanfranblanco
May 13 2016 14:19
ok I got you, you are using the chain as a verification system that the content matches
rickzanux
@rickzanux
May 13 2016 14:20
yes
Juan Blanco
@juanfranblanco
May 13 2016 14:21
I have thoughts for something similar, but not that specific use case :)
rickzanux
@rickzanux
May 13 2016 14:21
i think that now is one of the basic use
Juan Blanco
@juanfranblanco
May 13 2016 14:21
yes, public records
rickzanux
@rickzanux
May 13 2016 14:22
yes
lets see.
i ahve a long way to finish the project . just working at night
what are you working in?