计算文本和文件的MD5值 Compute MD5 hash of string or file
Switch branches/tags
Clone or download
Latest commit 002b4d4 Oct 21, 2018
Permalink
Failed to load latest commit information.
Sources improve preformence Oct 18, 2018
.gitignore add all files Oct 11, 2018
LICENSE Initial commit Oct 11, 2018
README.md add all files Oct 11, 2018
YZYMD5.podspec Update YZYMD5.podspec Oct 21, 2018
_config.yml Set theme jekyll-theme-cayman Oct 11, 2018

README.md

YZYMD5

YZYMD5用Swift编程语言编写,用来计算文本和文件的MD5值,对于大文件只占用极少的内存。 YZYMD5可以用在iOS和MacOS的开发上。

Computing MD5 hash of string or file with small memory usage in swift, supports iOS and MacOS

示例 Examples

计算文本字符串的MD5值 Computing MD5 hash of string

let md5 = YZYMD5()
md5.update("hello world")
print(md5.digestHex())


输出:
Output:

5EB63BBBE01EEED093CB22BB8F5ACDC3

计算文件的MD5值 Computing MD5 hash of file

let md5 = YZYMD5()
print(md5.digestHexFromFile("/Users/yzy/1.txt"))


输出:
Output:

5EB63BBBE01EEED093CB22BB8F5ACDC3

和我联系 Contact me

我的邮箱是:14497294@qq.com 欢迎交流。 My email address: 14497294@qq.com