$ pry
[1] pry(main)> Digest::MD5.hexdigest("Linux")
NameError: uninitialized constant Digest
from (pry):1:in `__pry__'
[2] pry(main)> require 'securerandom'
=> true
[3] pry(main)> Digest::MD5.hexdigest("Linux")
=> "edc9f0a5a5d57797bf68e37364743831"
为什么没有requre 'digest/md5'
,也可以用 Digest::MD5.hexdigest 方法呢?securerandom 里加载了 Digest 吗?
求解。Thanks.