Transferred ShieldAI-related files mistakenly placed in ~/code/FrenoCorp:
- Services: spamshield (feature-flags, audit-logger, error-handler), voiceprint (config, service, feature-flags), darkwatch (pipeline, scan, scheduler, watchlist, webhook)
- Packages: shared-analytics, shared-auth, shared-ui, shared-utils (new); shared-billing, jobs supplemented with unique FC files
- Server: alerts (FC version newer), routes (spamshield, darkwatch, voiceprint)
- Config: turbo.json, tsconfig.base.json, vite/vitest configs, drizzle, Dockerfile
- VoicePrint ML service
- Examples
Pending: apps/{api,web,mobile}/ structured merge, shared-db/db mapping
Co-Authored-By: Paperclip <noreply@paperclip.ing>
13 lines
369 B
TypeScript
13 lines
369 B
TypeScript
/**
|
|
* Hash a phone number for analytics purposes
|
|
* Uses a consistent hashing algorithm to create a deterministic hash
|
|
*/
|
|
export function hashPhoneNumber(phoneNumber: string): string {
|
|
let hash = 0;
|
|
for (let i = 0; i < phoneNumber.length; i++) {
|
|
hash = ((hash << 5) - hash) + phoneNumber.charCodeAt(i);
|
|
hash |= 0;
|
|
}
|
|
return `hash_${Math.abs(hash)}`;
|
|
}
|