我正在嘗試通過 HTTP 將 SHA256 散列字符串發(fā)送到服務器,我想通過執(zhí)行 SHA256 散列并驗證兩個匹配來進行身份驗證。出于測試目的,我使用相同的字符串,但是我的結(jié)果不匹配。這可能是我的 base64_encode 調(diào)用的默認編碼方案嗎?謝謝。在 PHP 我正在做:$sha = hash("sha256", $url, true);$sha = base64_encode(urlencode($sha));在圍棋中我正在做//convert string to byte sliceconverted := []byte(to_hash)//hash the byte slice and return the resulting stringhasher := sha256.New()hasher.Write(converted)return (base64.URLEncoding.EncodeToString(hasher.Sum(nil)))
- 1 回答
- 0 關(guān)注
- 647 瀏覽
添加回答
舉報
0/150
提交
取消