I ran into this problem while doing something similar.
What I did was like an echo string | sha256sum echo string | sha256sum , I think.
I would have got a different result when I ran this through the php hash generator. The reason was that a new line added an echo.
I don't know if you use echo, but if you try echo -n string | sha256num echo -n string | sha256num .
source share