Home / Function/ decryptString() — astro Function Reference

decryptString() — astro Function Reference

Architecture documentation for the decryptString() function in encryption.ts from the astro codebase.

Entity Profile

Dependency Diagram

graph TD
  178268e4_e3b6_a2ae_d49e_2ec9103d7953["decryptString()"]
  94fbb11e_4aa9_9dfd_28d5_cc0eb8749e6c["encryption.ts"]
  178268e4_e3b6_a2ae_d49e_2ec9103d7953 -->|defined in| 94fbb11e_4aa9_9dfd_28d5_cc0eb8749e6c
  style 178268e4_e3b6_a2ae_d49e_2ec9103d7953 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/astro/src/core/encryption.ts lines 103–116

export async function decryptString(key: CryptoKey, encoded: string) {
	const iv = decodeHex(encoded.slice(0, IV_LENGTH)) as Uint8Array<ArrayBuffer>;
	const dataArray = decodeBase64(encoded.slice(IV_LENGTH)) as Uint8Array<ArrayBuffer>;
	const decryptedBuffer = await crypto.subtle.decrypt(
		{
			name: ALGORITHM,
			iv,
		},
		key,
		dataArray,
	);
	const decryptedString = decoder.decode(decryptedBuffer);
	return decryptedString;
}

Domain

Subdomains

Frequently Asked Questions

What does decryptString() do?
decryptString() is a function in the astro codebase, defined in packages/astro/src/core/encryption.ts.
Where is decryptString() defined?
decryptString() is defined in packages/astro/src/core/encryption.ts at line 103.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free