sha256() — svelte Function Reference
Architecture documentation for the sha256() function in crypto.js from the svelte codebase.
Entity Profile
Dependency Diagram
graph TD a6460863_04d4_2187_b17f_03fcb0b078b2["sha256()"] 3cae8e56_c0fb_4ba6_0874_ffdf0dfa134c["crypto.js"] a6460863_04d4_2187_b17f_03fcb0b078b2 -->|defined in| 3cae8e56_c0fb_4ba6_0874_ffdf0dfa134c 67e574ef_12ff_a34a_1e29_df1a6a01a768["ctx()"] 67e574ef_12ff_a34a_1e29_df1a6a01a768 -->|calls| a6460863_04d4_2187_b17f_03fcb0b078b2 fff62c65_3d04_7c7d_74a5_524b832bae38["base64_encode()"] a6460863_04d4_2187_b17f_03fcb0b078b2 -->|calls| fff62c65_3d04_7c7d_74a5_524b832bae38 style a6460863_04d4_2187_b17f_03fcb0b078b2 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
packages/svelte/src/internal/server/crypto.js lines 8–21
export async function sha256(data) {
text_encoder ??= new TextEncoder();
// @ts-expect-error
crypto ??= globalThis.crypto?.subtle?.digest
? globalThis.crypto
: // @ts-ignore - we don't install node types in the prod build
// don't use 'node:crypto' because static analysers will think we rely on node when we don't
(await import(/* @vite-ignore */ 'node:' + 'crypto')).webcrypto;
const hash_buffer = await crypto.subtle.digest('SHA-256', text_encoder.encode(data));
return base64_encode(hash_buffer);
}
Domain
Subdomains
Calls
Called By
Source
Frequently Asked Questions
What does sha256() do?
sha256() is a function in the svelte codebase, defined in packages/svelte/src/internal/server/crypto.js.
Where is sha256() defined?
sha256() is defined in packages/svelte/src/internal/server/crypto.js at line 8.
What does sha256() call?
sha256() calls 1 function(s): base64_encode.
What calls sha256()?
sha256() is called by 1 function(s): ctx.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free