Ruby 2.4参考手册
摘要 | Digest
Digest::MD5
Parent:Digest::Base
一个计算消息摘要的类:使用的是RFC 1321中描述的RSA Data Security,以及Inc.使用MD5消息摘要算法。
MD5计算128位(16字节)的摘要。
例子
require 'digest'
# Compute a complete digest
Digest::MD5.hexdigest 'abc' #=> "90015098..."
# Compute digest by chunks
md5 = Digest::MD5.new # =>#<Digest::MD5>
md5.update "ab"
md5 << "c" # alias for #update
md5.hexdigest # => "90015098..."
# Use the same object to compute another digest
md5.reset
md5 << "message"
md5.hexdigest # => "78e73102..."
摘要 | Digest相关
Ruby 是一种面向对象、命令式、函数式、动态的通用编程语言,是世界上最优美而巧妙的语言。
主页 | https://www.ruby-lang.org/ |
源码 | https://github.com/ruby/ruby |
版本 | 2.4 |
发布版本 | 2.4.1 |