【问题标题】:Azure Mobile Services generate secure hashAzure 移动服务生成安全哈希
【发布时间】:2013-11-17 09:18:29
【问题描述】:

如何在移动服务 API 方法中为字符串生成 SHA-1(或其他哈希)?

我在 .NET 中找不到任何加密 API。

【问题讨论】:

  • 您应该考虑 SHA-2。它具有比 SHA-1 强得多的抗碰撞性。 (如果您将它们用于密码哈希,则两者同样错误)

标签: node.js azure cryptography sha azure-mobile-services


【解决方案1】:

您是否查看过cypto.createHash() function 以及相关的hash.update()hash.digest() 函数?

用法:

  var crypto = require('crypto')
      , sha1sum = crypto.createHash('sha1');

  sha1sum.update("foo");
  console.log(sha1sum.digest('hex'));
  // "0beer45dfsab5ea389fd0sdfuj309bcis9"

【讨论】:

    猜你喜欢
    • 2018-12-09
    • 2013-11-29
    • 1970-01-01
    • 2018-05-16
    • 1970-01-01
    • 2012-04-28
    • 2011-06-08
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多