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?

1 Answer 1


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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.