refactor: Creation d'un provider et d'un systeme de middleware

This commit is contained in:
Luc SORIGNET
2025-02-22 13:05:01 +01:00
parent c861239d48
commit 508847940c
18 changed files with 218 additions and 69 deletions

View File

@ -0,0 +1,11 @@
import crypto from 'crypto';
export function getGravatarUrl(email, size = 32) {
if(email === undefined || typeof email !== 'string') {
return 'https://www.gravatar.com/avatar/';
}
else {
const hash = crypto.createHash('md5').update(email.toLowerCase().trim()).digest('hex');
return `https://www.gravatar.com/avatar/${hash}?s=${size}&d=identicon`;
}
}