<commit_before>import crypto from 'crypto';
import { toSvg } from 'jdenticon';
import LS from 'lib/wallet/localStorage';
import details from 'lib/wallet/details';

export function getAvatar(size = 64) {
  const userInfo = details.get('userInfo');
  const email = (userInfo.email || '').trim().toLowerCase();
  let id;
  if (email) {
    const hash = crypto.createHash('md5').update(email).digest('hex');
    id = `gravatar:${hash}`;
  } else {
    const hash = crypto.createHmac('sha256', 'Coin Wallet').update(LS.getDetailsKey()).digest('hex');
    id = `identicon:${hash}`;
  }
  return {<commit_msg>fix: getAvatar<commit_after>import crypto from 'crypto';
import { toSvg } from 'jdenticon';
import LS from 'lib/wallet/localStorage';
import details from 'lib/wallet/details';

export function getAvatar(size = 64) {
  const userInfo = details.get('userInfo');
  const email = (userInfo.email || '').trim().toLowerCase();
  let id;
  if (email) {
    const hash = crypto.createHash('md5').update(email).digest('hex');
    id = `gravatar:${hash}`;
  } else {
    const hash = crypto.createHmac('sha256', 'Coin Wallet').update(LS.getDetailsKey() || '').digest('hex');
    id = `identicon:${hash}`;
  }
  return {
{'fraction_non_alphanumeric': 0.18084227910817507, 'fraction_numerical': 0.00990916597853014, 'mean_word_length': 4.611111111111111, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '81056', 'n_tokens_mistral': 410, 'n_tokens_neox': 407, 'n_words': 92}