(obj: T)
| 24 | ); |
| 25 | |
| 26 | async function packObject<T>(obj: T): Promise<string> { |
| 27 | const json = JSON.stringify(obj); |
| 28 | const bytes = new TextEncoder().encode(json).buffer; |
| 29 | const signature = await crypto.subtle.sign('HMAC', bridgeKey, bytes); |
| 30 | return btoa(json) + '|' + base64.encode(signature); |
| 31 | } |
| 32 | |
| 33 | async function unpackObject<T>(str: string): Promise<T | null> { |
| 34 | try { |
nothing calls this directly
no outgoing calls
no test coverage detected