(path, body, timestamp)
| 42 | }); |
| 43 | |
| 44 | function sign256(path, body, timestamp) { |
| 45 | const bodyStr = body ? JSON.stringify(body) : ""; |
| 46 | return crypto.createHash("sha256").update(path + bodyStr + HA_APP_ID + HA_APP_KEY + timestamp).digest("hex"); |
| 47 | } |
| 48 | |
| 49 | function maskToken(token = "") { |
| 50 | if (!token) return ""; |