From c5d3db7993b5ca39b48d055a5b42a57113757839 Mon Sep 17 00:00:00 2001 From: Shav Kinderlehrer Date: Mon, 16 Oct 2023 14:08:23 -0400 Subject: Shorten hash + add '+' operator --- src/post.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/post.ts') diff --git a/src/post.ts b/src/post.ts index 538ff00..94643d4 100644 --- a/src/post.ts +++ b/src/post.ts @@ -20,7 +20,7 @@ export async function post_c(body: any, sql: Sql) { custom_id = false; const hasher = new Bun.CryptoHasher("md5"); hasher.update(form.url.href); - form.id = hasher.digest("hex").slice(0, 11); + form.id = hasher.digest("hex").slice(0, 4); } const valid_re = /^[A-z0-9_-]+$/; -- cgit v1.2.3