forked from astaxie/gopkg
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
3 changed files
with
52 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
## const BlockSize = 64 | ||
|
||
功能说明: | ||
|
||
The blocksize of MD5 in bytes. | ||
MD5的数据块的字节长度为64字节。 | ||
|
||
## const Size = 16 | ||
|
||
功能说明: | ||
|
||
The size of an MD5 checksum in bytes. | ||
MD5的校验和的字节长度为16字节。 | ||
|
||
具体使用参见[func New() hash.Hash](New.md) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
## func New() hash.Hash | ||
|
||
参数列表 | ||
|
||
- 无 | ||
|
||
返回值: | ||
|
||
- 返回hash.Hash类型 | ||
|
||
功能说明: | ||
|
||
New returns a new hash.Hash computing the MD5 checksum. | ||
New方法返回一个hash.Hash类型,用于计算MD5的校验和。 | ||
|
||
代码实例: | ||
|
||
package main | ||
|
||
import ( | ||
"crypto/md5" | ||
"fmt" | ||
"io" | ||
) | ||
|
||
// 官网的例子:http://golang.org/pkg/crypto/md5/ | ||
func main() { | ||
h := md5.New() | ||
io.WriteString(h, "The fog is getting thicker!") | ||
io.WriteString(h, "And Leon's getting laaarger!") | ||
fmt.Printf("%x", h.Sum(nil)) | ||
} | ||
// e2c569be17396eca2a2e3c11578123ed | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,4 @@ | ||
# 包名 | ||
# crypto/md5包函数列表 | ||
|
||
函数列表 | ||
|
||
- xxx1 | ||
- xxx2 | ||
- [Constants](Constants.md) | ||
- [func New() hash.Hash](New.md) |