Skip to content

Commit aac27d2

Browse files
committed
replace kw prefix
1 parent 97e6660 commit aac27d2

File tree

2 files changed

+17
-17
lines changed

2 files changed

+17
-17
lines changed

contracts/crypto/LibCryptoHash.sol

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,34 +2,34 @@ pragma solidity ^0.4.25;
22
library LibCryptoHash {
33
event TestLog(bytes32 value);
44

5-
function kw_keccak256(string memory s1) public returns(bytes32 result){
5+
function getKeccak256(string memory s1) public returns(bytes32 result){
66
bytes32 a = keccak256(abi.encodePacked(s1));
77
emit TestLog(a);
88

99
return a;
1010
}
1111

12-
function kw_sha3(string memory s1) public returns(bytes32 result){
12+
function getSha3(string memory s1) public returns(bytes32 result){
1313
bytes32 a = sha3(bytes(s1));
1414
emit TestLog(a);
1515
return a;
1616

1717
}
1818

19-
function kw_sha256(string memory s1) public returns(bytes32 result){
19+
function getSha256(string memory s1) public returns(bytes32 result){
2020
bytes32 a = sha256(bytes(s1));
2121
emit TestLog(a);
2222
return a;
2323

2424
}
2525

26-
function kw_ripemd160(string memory s1) public returns(bytes20 result){
26+
function getRipemd160(string memory s1) public returns(bytes20 result){
2727
bytes20 a = ripemd160(bytes(s1));
2828
emit TestLog(a);
2929
return a;
3030
}
3131

32-
function kw_sha3(string memory s1) public returns(bytes32 result){
32+
function getSha3(string memory s1) public returns(bytes32 result){
3333
bytes32 a = sha3(bytes(s1));
3434
emit TestLog(a);
3535
return a;

docs/Crypto/LibCryptoHash.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,16 @@ LibCryptoHash 提供了solidity内置函数keccak256、sha3、ripemd160等计算
1010

1111
contract test {
1212
function t_keccak(string memory s1) public returns (bytes32 result) {
13-
return LibCryptoHash.kw_keccak256(s1);
13+
return LibCryptoHash.getKeccak256(s1);
1414
}
1515
function t_sha3(string memory s1) public view returns (bytes32 result) {
16-
return LibCryptoHash.kw_sha3(s1);
16+
return LibCryptoHash.getSha3(s1);
1717
}
1818
function t_sha256(string memory s1) public returns (bytes32 result) {
19-
return LibCryptoHash.kw_sha256(s1);
19+
return LibCryptoHash.getSha256(s1);
2020
}
2121
function setripemd160(string memory s1) public view returns (bytes20 result) {
22-
return LibCryptoHash.kw_ripemd160(s1);
22+
return LibCryptoHash.getRipemd160(s1);
2323
}
2424
}
2525
```
@@ -28,14 +28,14 @@ LibCryptoHash 提供了solidity内置函数keccak256、sha3、ripemd160等计算
2828

2929
编号 | API | API描述
3030
---|---|---
31-
1 | *kw_keccak256(string memory s1) public returns(bytes32 result)* | keccak256算法
32-
2 | *kw_sha3(string memory s1) public returns(bytes32 result)* | sha3算法等同于keccak256。
33-
3 | *kw_sha256(string memory s1) public returns(bytes32 result)* | sha256算法。
34-
4 | *kw_ripemd160(string memory s1) public returns(bytes20 result)* | ripemd160算法。
31+
1 | *getKeccak256(string memory s1) public returns(bytes32 result)* | keccak256算法
32+
2 | *getSha3(string memory s1) public returns(bytes32 result)* | sha3算法等同于keccak256。
33+
3 | *getSha256(string memory s1) public returns(bytes32 result)* | sha256算法。
34+
4 | *getRipemd160(string memory s1) public returns(bytes20 result)* | ripemd160算法。
3535

3636
## API详情
3737

38-
### ***1. kw_keccak256 函数***
38+
### ***1. getKeccak256 函数***
3939

4040
keccak256算法
4141

@@ -48,7 +48,7 @@ keccak256算法
4848

4949
## API详情
5050

51-
### ***1. kw_sha3 函数***
51+
### ***1. getSha3 函数***
5252

5353
sha3算法等同于keccak256
5454

@@ -60,7 +60,7 @@ sha3算法等同于keccak256
6060
- result: byte32
6161
## API详情
6262

63-
### ***1. kw_sha256 函数***
63+
### ***1. getSha256 函数***
6464

6565
sha256算法
6666

@@ -72,7 +72,7 @@ sha256算法
7272
- result: byte32
7373
## API详情
7474

75-
### ***1. kw_ripemd160 函数***
75+
### ***1. getRipemd160 函数***
7676

7777
ripemd160算法
7878

0 commit comments

Comments
 (0)