MCPcopy Create free account
hub / github.com/smallfawn/QLScriptPublic / deriveSecret

Function deriveSecret

wxapp/wps.js:193–197  ·  view source on GitHub ↗
(privateKey, serverJwkB64)

Source from the content-addressed store, hash-verified

191}
192
193function deriveSecret(privateKey, serverJwkB64) {
194 const jwk = JSON.parse(Buffer.from(serverJwkB64, "base64url").toString("utf8"));
195 const publicKey = crypto.createPublicKey({ key: jwk, format: "jwk" });
196 return crypto.diffieHellman({ privateKey, publicKey }).toString("base64url");
197}
198
199async function wxServerCode(openid, appid) {
200 const { data } = await axios.post(

Callers 1

loginMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected