Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Piping the output of ipfs object get into ipfs object put yields different hashes #1724

Closed
hackergrrl opened this issue Sep 18, 2015 · 3 comments · Fixed by #10375
Closed
Labels
need/verification This issue needs verification

Comments

@hackergrrl
Copy link
Contributor

But not always? For the string 'hello warld!' I get the same hashes, but not for this other arbitrary file I chose.

% ipfs add quotestoliveby.markdown 
added QmVVjWrps58cFS1hSvCdAxmS4wggKfRGbDzJway6QCxR4U quotestoliveby.markdown

% ipfs object get QmVVjWrps58cFS1hSvCdAxmS4wggKfRGbDzJway6QCxR4U > /tmp/original

% ipfs object put /tmp/original 
added QmWFg6qzE2UhyqKNwsQ7hyC93vfiVcukiC79KMSJ3ygorH

% ipfs object get QmWFg6qzE2UhyqKNwsQ7hyC93vfiVcukiC79KMSJ3ygorH > /tmp/new

% diff /tmp/original /tmp/new
% echo $?
0

Maybe there are some special characters causing this? No time to investigate yet. :)

@ion1
Copy link

ion1 commented Sep 18, 2015

Changing the encoding doesn’t affect it:

% ipfs object get --encoding=protobuf QmVVjWrps58cFS1hSvCdAxmS4wggKfRGbDzJway6QCxR4U | ipfs object put --inputenc=protobuf
added QmWFg6qzE2UhyqKNwsQ7hyC93vfiVcukiC79KMSJ3ygorH

object get outputs the same data for both regardless of the encoding:

% diff -u <(ipfs object get --encoding=protobuf QmVVjWrps58cFS1hSvCdAxmS4wggKfRGbDzJway6QCxR4U | hd) <(ipfs object get --encoding=protobuf QmWFg6qzE2UhyqKNwsQ7hyC93vfiVcukiC79KMSJ3ygorH | hd)
%

The on-disk blocks are indeed different:

% diff -u <(cat -A ~/.ipfs/blocks/12206a55/12206a557853dd1e9ac632620516222795b3c230dc5bf9b091b37dafff974dd05011.data) <(cat -A ~/.ipfs/blocks/12207597/122075972a54f664535a511a718a43390f8fab244461138e38c10e68178327d7433a.data)
--- /proc/self/fd/11    2015-09-18 21:33:12.472672153 +0300
+++ /proc/self/fd/13    2015-09-18 21:33:12.476672216 +0300
@@ -1,5 +1,5 @@
 $
-M-)^H^H^B^RM-!^H"Call bullshit on safety and face your fears daily. DonM-bM-^@M-^Yt be afraid of the$
+M--^H^H^B^RM-oM-?M-=^H"Call bullshit on safety and face your fears daily. DonM-bM-^@M-^Yt be afraid of the$
 unknown. Discovery only happens in the unknown." - David du Chemin$
 (http://petapixel.com/2014/06/02/jennifer-whomever/)$
 $
@@ -22,4 +22,4 @@
 stuckM-bM-^@M-^] only means youM-bM-^@M-^Yre refusing to shine a light on whatM-bM-^@M-^Ys really going on$
 with you. Words light it right up." - David Cain$
 $
-^XM-!^H
\ No newline at end of file
+^XM-oM-?M-=^H
\ No newline at end of file

@chriscool
Copy link
Contributor

This look similar as: #1582

@jbenet
Copy link
Member

jbenet commented Sep 23, 2015

Yes, i suspect #1582 as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
need/verification This issue needs verification
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants