MCPcopy Create free account
hub / github.com/ShipSecAI/studio / parseMasterKey

Function parseMasterKey

packages/shared/src/secrets/encryption.ts:121–127  ·  view source on GitHub ↗
(raw: string)

Source from the content-addressed store, hash-verified

119
120// Helper to prepare a 32-byte master key
121export function parseMasterKey(raw: string): ArrayBuffer {
122 const bytes = new TextEncoder().encode(raw);
123 if (bytes.byteLength !== 32) {
124 throw new Error('Key must be exactly 32 bytes.');
125 }
126 return bytes.buffer.slice(bytes.byteOffset, bytes.byteOffset + bytes.byteLength) as ArrayBuffer;
127}

Callers 5

constructorMethod · 0.90
constructorMethod · 0.90
constructorMethod · 0.90
constructorMethod · 0.90

Calls 1

encodeMethod · 0.80

Tested by

no test coverage detected