erlang java 加解密(2)消息摘要算法(MD、SHA、MAC)之SHA

java加解密相关资料和代码参考《java加密与解密的艺》http://snowolf.iteye.com/blog/379860

 

 

sha(Data) -> Digest
Types:
Data = iolist() | binary()
Digest = binary()
Computes an SHA message digest from Data, where the length of the digest is 160 bits (20 bytes).
计算Data的SHA消息摘要。
摘要的长度是160位(20字节)。

sha_init() -> Context
Types:
 Context = binary()
Creates an SHA context, to be used in subsequent calls to 
sha_update/2.
创建SHA的context  用于之后的sha_update/2

sha_update(Context, Data) -> NewContext
Types:
 Data = iolist() | binary()
Context = NewContext = binary()
Updates an SHA Context with Data, and returns a NewContext.
用Data更新一个SHA的context  返回NewContext

sha_final(Context) -> Digest
Types:
 Context = Digest = binary()
Finishes the update of an SHA Context and returns the computed SHA message digest.
完成SHA Context的更新  ,返回SHA信息摘要

你可能感兴趣的:(erlang)