diff options
Diffstat (limited to 'app/src/lib')
-rw-r--r-- | app/src/lib/index.ts | 1 | ||||
-rw-r--r-- | app/src/lib/svelte/Navigation.svelte | 11 | ||||
-rw-r--r-- | app/src/lib/ts/crc32.worker.ts | 8 |
3 files changed, 19 insertions, 1 deletions
diff --git a/app/src/lib/index.ts b/app/src/lib/index.ts deleted file mode 100644 index 856f2b6..0000000 --- a/app/src/lib/index.ts +++ /dev/null @@ -1 +0,0 @@ -// place files you want to import through the `$lib` alias in this folder. diff --git a/app/src/lib/svelte/Navigation.svelte b/app/src/lib/svelte/Navigation.svelte new file mode 100644 index 0000000..20c7d8b --- /dev/null +++ b/app/src/lib/svelte/Navigation.svelte @@ -0,0 +1,11 @@ +<script lang="ts"> + import { AppRail, AppRailAnchor } from '@skeletonlabs/skeleton'; + import { page } from '$app/stores'; +</script> + +<AppRail> + <svelte:fragment slot="lead"> + <AppRailAnchor href="/" selected={$page.url.pathname === '/'}>Home!</AppRailAnchor> + </svelte:fragment> + <AppRailAnchor href="/crc32" selected={$page.url.pathname === '/crc32'}>CRC32</AppRailAnchor> +</AppRail> diff --git a/app/src/lib/ts/crc32.worker.ts b/app/src/lib/ts/crc32.worker.ts new file mode 100644 index 0000000..0d04c7c --- /dev/null +++ b/app/src/lib/ts/crc32.worker.ts @@ -0,0 +1,8 @@ +import crc32 from 'crc/crc32'; + +onmessage = async (message: MessageEvent<File>) => { + const file = message.data; + const buffer = await file.arrayBuffer(); + const crc = crc32(buffer, 517762881); + postMessage(crc); +}; |