gpt4 book ai didi

node.js - Node crypto 包中 crypto.randomBytes(32) 在 Golang 中的等价物是什么?

转载 作者:IT王子 更新时间:2023-10-29 02:29:59 26 4
gpt4 key购买 nike

大家好,我主要是想重新创建这个 Node 包:

https://github.com/seishun/node-steam-crypto/blob/master/index.js

golang 中,这样我就可以对需要这些加密的 sessionKeys 的 Steam API 进行 API 调用。

我正在查看 crypto 包,但有很多不同的哈希方法可供使用,我不确定哪一个最接近

crypto.randomBytes(32) 在 Node 包中。

还有

crypto.publicEncrypt()

抱歉,如果这个问题是废话,我不确定该怎么表达它,因为我以前没有真正处理过这类问题。任何信息都将非常感谢。

最佳答案

rand.Read :

import "crypto/rand"

b := make([]byte, 32)
_, err := rand.Read(b)

关于node.js - Node crypto 包中 crypto.randomBytes(32) 在 Golang 中的等价物是什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32163173/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com