Skip to content

Commit 1a36120

Browse files
authored
Merge pull request #237 from AbdulSnk/devBranch
feat(referrals): scaffold referral system with code generation and en…
2 parents b529621 + 4817e63 commit 1a36120

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
export function generateReferralCode(length = 8): string {
2+
const chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
3+
let result = '';
4+
5+
for (let i = 0; i < length; i++) {
6+
result += chars.charAt(Math.floor(Math.random() * chars.length));
7+
}
8+
9+
return result;
10+
}

0 commit comments

Comments
 (0)