Skip to content

Commit 1e02670

Browse files
committed
fix: name FNV-1a constants, remove accidentally committed .kiro/settings/lsp.json
1 parent c0040d1 commit 1e02670

File tree

6 files changed

+50
-201
lines changed

6 files changed

+50
-201
lines changed

.kiro/settings/lsp.json

Lines changed: 0 additions & 198 deletions
This file was deleted.
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
- generic [active] [ref=e1]:
2+
- generic [ref=e2]:
3+
- generic [ref=e3]:
4+
- heading "Todo App" [level=2] [ref=e4]
5+
- paragraph [ref=e5]: Sign in to manage your tasks
6+
- generic [ref=e8]:
7+
- paragraph [ref=e9]: Please sign in with your Cognito account to continue
8+
- link "Sign in with Cognito" [ref=e10] [cursor=pointer]:
9+
- /url: /api/auth/sign-in
10+
- contentinfo [ref=e11]:
11+
- paragraph [ref=e12]: © 2026 Todo App. All rights reserved.
12+
- link "Static Test Page" [ref=e13] [cursor=pointer]:
13+
- /url: /static-test
14+
- region "Notifications alt+T"
15+
- alert [ref=e14]
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
- generic [active] [ref=e1]:
2+
- generic [ref=e2]:
3+
- generic [ref=e3]:
4+
- heading "Todo App" [level=2] [ref=e4]
5+
- paragraph [ref=e5]: Sign in to manage your tasks
6+
- generic [ref=e8]:
7+
- paragraph [ref=e9]: Please sign in with your Cognito account to continue
8+
- link "Sign in with Cognito" [ref=e10] [cursor=pointer]:
9+
- /url: /api/auth/sign-in
10+
- contentinfo [ref=e11]:
11+
- paragraph [ref=e12]: © 2026 Todo App. All rights reserved.
12+
- link "Static Test Page" [ref=e13] [cursor=pointer]:
13+
- /url: /static-test
14+
- region "Notifications alt+T"
15+
- alert [ref=e14]
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
- generic [active] [ref=e1]:
2+
- generic [ref=e15]:
3+
- heading "Static Test Page" [level=1] [ref=e16]
4+
- paragraph [ref=e17]: This page is statically rendered for cache testing.
5+
- paragraph [ref=e18]: "Build time: 2026-03-20T03:13:22.937Z"
6+
- region "Notifications alt+T"
7+
- alert [ref=e14]
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
- generic [active] [ref=e1]:
2+
- generic [ref=e2]:
3+
- heading "Static Test Page" [level=1] [ref=e3]
4+
- paragraph [ref=e4]: This page is statically rendered for cache testing.
5+
- paragraph [ref=e5]: "Build time: 2026-03-20T03:13:22.937Z"
6+
- region "Notifications alt+T"
7+
- alert [ref=e6]

cdk/lib/constructs/cf-lambda-furl-service/cf-function/cache-key.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,15 @@ async function handler(event) {
2323
}
2424
}
2525
if (key) {
26-
// FNV-1a hash. Cryptographic strength is unnecessary;
26+
// FNV-1a hash (32-bit). Cryptographic strength is unnecessary;
2727
// we only need distinct cache keys for distinct header combinations.
28-
var hash = 2166136261;
28+
// See: https://en.wikipedia.org/wiki/Fowler%E2%80%93Noll%E2%80%93Vo_hash_function
29+
var FNV_OFFSET_BASIS = 2166136261;
30+
var FNV_PRIME = 16777619;
31+
var hash = FNV_OFFSET_BASIS;
2932
for (var j = 0; j < key.length; j++) {
3033
hash ^= key.charCodeAt(j);
31-
hash = (hash * 16777619) | 0;
34+
hash = (hash * FNV_PRIME) | 0;
3235
}
3336
event.request.headers['x-nextjs-cache-key'] = { value: String(hash >>> 0) };
3437
}

0 commit comments

Comments
 (0)