Skip to content

Commit

Permalink
affiliateCodeGenerator: Get the first 8 characters
Browse files Browse the repository at this point in the history
  • Loading branch information
sashko9807 committed Oct 24, 2023
1 parent 480524a commit 7245c78
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion apps/api/src/affiliate/utils/affiliateCodeGenerator.ts
Original file line number Diff line number Diff line change
@@ -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
}

0 comments on commit 7245c78

Please sign in to comment.