Skip to content

Commit cb94044

Browse files
committed
mapping/ hashing 수정
1 parent 30118b3 commit cb94044

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

passwordcheck.sol

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,24 @@ contract Registration {
1212
}
1313

1414
//해시의 결과값과 멤버의 index 를 mapping 할 예정
15+
member[] Member;
16+
mapping(address => uint) number;
17+
// 이중 mapping 들어가야 할 듯
18+
member [] Member_2;
19+
mapping(address => uint) hash_map;
1520

16-
function hashing(uint _index, address _address, string memory _name, uint _password) public {
21+
function hashing(uint _index, address _address, string memory _name, uint _password) public returns(bytes32) {
1722

23+
bytes32 hash_result = keccak256(abi.encodePacked(_index, _address, _name, _password));
24+
25+
return hash_result;
1826
}
1927

20-
function addmember(uint _index, address _address, string memory _name, uint _password) public {
28+
function addmember(uint _index, address _address, string memory _name, uint _password) public returns(bytes32) {
2129

30+
number[_address];
31+
bytes32 hashing_result;
32+
hashing_result = hashing(_index, _address, _name, _password);
2233
}
34+
35+
}

0 commit comments

Comments
 (0)