MCPcopy Create free account
hub / github.com/Treeki/BirdBridge / packObject

Function packObject

apis/authflow.ts:26–31  ·  view source on GitHub ↗
(obj: T)

Source from the content-addressed store, hash-verified

24);
25
26async 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
33async function unpackObject<T>(str: string): Promise<T | null> {
34 try {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected