I have a simple smart contract as below. Using go-ethereum-1.8.6 , when i execute contract.sha.call() it returns the correct hash value. However, contract.getSha256.call() it returns 0x, did I do something wrong?
pragma solidity ^0.4.23;
/* Online compiler https://remix.ethereum.org */
contract test{
address public owner;
constructor() public {
owner = msg.sender;
}
function getOwner() external view returns (address) {
return owner;
}
function getSha256() external pure returns (bytes32) {
bytes32 hash = sha256("12345678");
return (hash);
}
function sha() external pure returns (bytes32) {
bytes32 hash = sha3("12345678");
return (hash);
}
}
keccak256. – leonprou Apr 30 '18 at 09:09