【问题标题】:How to authenticate the GKLocalPlayer on my Node.js server如何在我的 Node.js 服务器上验证 GKLocalPlayer
【发布时间】:2014-06-07 01:04:24
【问题描述】:

在Apple's Doc, generateIdentityVerificationSignatureWithCompletionHandler 中,您要连接到数据缓冲区中的 4 个参数,其中之一是“时间戳参数 in Big-Endian UInt-64 格式”,然后生成一个 SHA- 1 个用于验证的哈希值。

有没有人在 Node.js/Javascript 中成功完成这项工作? 我遇到的主要问题是 Javascript/Node.js 似乎不支持 64 位无符号大端整数;它似乎 max out 在 32 位,无符号。

PS:我知道有以下相关问题,但他们没有解决这个特定的 javascript 问题。

  1. How to authenticate the GKLocalPlayer on my 'third party server'?:解决方案适用于 ruby​​、python 和 obj-c;全部 具有为生成 64 位 BE hex 的本机支持 时间戳。
  2. How to authenticate Game Center User from 3rd party node.js server:代码依赖于客户端向服务器发送 时间戳已经以十六进制字符串的形式(见 json.hexTimestamp,大约 ln 22)

是否有可能可靠地创建 64 位无符号大端序的十六进制表示...在 javascript 中?我正在考虑通过 Node.js 执行 ruby​​/python 作为一种可能的解决方法。

【问题讨论】:

    标签: javascript ios node.js authentication certificate


    【解决方案1】:

    更简单的方法是使用 ref

    var ref = require('ref');
    
    var buf = ref.alloc('uint64');
    ref.writeUInt64BE(buf, 0, '1401893400733');
    

    之后,您可以使用缓冲区来更新验证器。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2014-03-20
      • 2023-03-20
      • 2017-07-16
      • 2022-06-16
      • 1970-01-01
      • 2013-07-29
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多