If I calculate the following in Solidity 0.6.3:
bytes memory secretSalt = "abc"; hashedSecret = sha256(abi.encodePacked(secretSalt))
I get the result "0xba7816bf8f01cfea414140de5dae2223b00361a396177a9cb410ff61f20015ad" which matches what I get on two online SHA256 generators when I input "abc" (though, without the quotes, see here and here).
But if I try
uint secretNumber = 5; hashedSecret = sha256(abi.encodePacked(secretNumber));
The result is "0x96de8fc8c256fa1e1556d41af431cace7dca68707c78dd88c3acab8b17164c47" which does not match those online SHA256 generators. I tried various hex representations of 5 on the online SHA256 generators and still cannot get "0x96de..."
Any thoughts on how Solidity is transforming the number "uint 5", relative to these common SHA256 implementations?