get id from hash value
pragma solidity ^0.4.18;
contract Hash {
bytes32 comphash;
struct hashstruct {
bytes32 fhash;
}
mapping (uint => hashstruct) hashstructs;
uint[] public hashAccts;
mapping(bytes32 => uint) _map;
function setinstructor(uint _uint,string _fhash) public {
var a = hashstructs[_uint];
a.fhash = sha256(_fhash);
hashAccts.push(_uint) -1;
_map[keccak256(a.fhash)] = _uint; // Can pass in other struct members as well
}
function getInstructor(uint ins) view public returns (bytes32) {
return (hashstructs[ins].fhash);
}
function count() view public returns (uint) {
return hashAccts.length;
}
}