2

I have created a Student registration form and taking input as firstName, lastName and studentRegId. Something like this:

contract Unique {

string fn;
string ln;
bytes20  val;
bytes32 sId;

function identify(string s, string y, bytes32 i)returns (bytes20){
    fn =s;
    ln =y;
    sId =i;
    val = keccak256(sm,bm,vm);
}

function getOut()constant returns (bytes20 ){
    return val;
}
}    

This should return a hash value (address). But it is showing the following error:

Untitled1:13:25: Error: Undeclared identifier.
    val = keccak256(sm,bm,vm); 

What should I do?

eth
  • 85,679
  • 53
  • 285
  • 406
Rahul Sharma
  • 1,303
  • 2
  • 16
  • 24

1 Answers1

5

keccak256 is available in Solidity 0.4.3 and later.

If you're using browser-solidity, Solidity 0.4.4 and later is needed: keccak256 Error Undeclared identifier in browser-solidity

eth
  • 85,679
  • 53
  • 285
  • 406