MCPcopy Create free account
hub / github.com/bewcloud/bewcloud / dataToText

Function dataToText

lib/auth.ts:27–27  ·  view source on GitHub ↗
(data: Uint8Array)

Source from the content-addressed store, hash-verified

25const textToData = (text: string) => new TextEncoder().encode(text);
26
27export const dataToText = (data: Uint8Array) => new TextDecoder().decode(data);
28
29export const generateKey = async (key: string): Promise<CryptoKey> =>
30 await crypto.subtle.importKey('raw', textToData(key), { name: 'HMAC', hash: 'SHA-256' }, false, ['sign', 'verify']);

Callers 3

decodeJwtMethod · 0.90
verifyAuthJwtFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected