From 7245c78a2f0ff5f97df62470e6a88da23aaf489a Mon Sep 17 00:00:00 2001 From: Alexander Petkov Date: Tue, 24 Oct 2023 17:22:31 +0300 Subject: [PATCH] affiliateCodeGenerator: Get the first 8 characters --- apps/api/src/affiliate/utils/affiliateCodeGenerator.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/api/src/affiliate/utils/affiliateCodeGenerator.ts b/apps/api/src/affiliate/utils/affiliateCodeGenerator.ts index 219be8d2f..a82d09e6a 100644 --- a/apps/api/src/affiliate/utils/affiliateCodeGenerator.ts +++ b/apps/api/src/affiliate/utils/affiliateCodeGenerator.ts @@ -1,6 +1,6 @@ import crypto from 'crypto' export function affiliateCodeGenerator(affiliateId: string) { - const uniqueHash = crypto.createHash('sha256').update(affiliateId).digest('hex').slice(0, 5) + const uniqueHash = crypto.createHash('sha256').update(affiliateId).digest('hex').slice(0, 8) return 'af_' + uniqueHash }