【问题标题】:Creating a SHA-256 hash in OrientDB Function在 OrientDB 函数中创建 SHA-256 哈希
【发布时间】:2015-04-21 18:53:54
【问题描述】:

我需要在 OrientDB REST 函数中存储密码的 SHA-256 哈希值 - 这样我就可以使用它来验证用户身份。对 REST 函数的传入调用将包含密码(通过 HTTPS),但我想生成一个哈希并存储它而不是密码本身。

但是,OrientDB 没有公开任何帮助程序来执行此操作。而且直接的 javascript 也没有帮手来做到这一点......我可以用什么方法来实现这一点?

(一个明显的选择是在中间层对其进行 SHA-256 处理并将其传递给 OrientDB,但我宁愿将其保留在数据库层中)

【问题讨论】:

    标签: orientdb sha


    【解决方案1】:

    您可以从像这样的 Javascript 函数中使用 OSecurityManager

    return com.orientechnologies.orient.core.security.OSecurityManager.instance().digest2String("password");
    

    【讨论】:

    • 很棒的信息@wolf4ood
    猜你喜欢
    • 2012-09-12
    • 2014-08-19
    • 2014-03-12
    • 2023-03-18
    • 2017-07-18
    • 2013-01-09
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多