【问题标题】:Why do digest and PKI.digest return different hash?为什么摘要和 PKI.digest 返回不同的哈希?
【发布时间】:2016-01-24 04:13:57
【问题描述】:

例如。当我用每个函数计算哈希时,我得到不同的结果。

PKI::PKI.digest("hola", "MD5")
digest::digest("hola", "md5")

【问题讨论】:

    标签: r pki digest


    【解决方案1】:

    serialize = FALSE 用于digest

    > PKI::PKI.digest("hola", "MD5")
     [1] 4d 18 63 21 c1 a7 f0 f3 54 b2 97 e8 91 4a b2 40
    > digest::digest("hola", "md5", serialize=FALSE)
    [1] "4d186321c1a7f0f354b297e8914ab240"
    

    digest的帮助页面说明输入默认是序列化的。

    【讨论】:

    • 我自己说得再好不过了 :)
    猜你喜欢
    • 2012-08-13
    • 2011-07-14
    • 2021-06-21
    • 2020-04-13
    • 1970-01-01
    • 2014-11-30
    • 1970-01-01
    • 1970-01-01
    • 2018-03-23
    相关资源
    最近更新 更多