You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@answer.apache.org by sh...@apache.org on 2024/08/06 08:44:33 UTC

(incubator-answer) branch fix/avatar-sha256 created (now ddbd36e4)

This is an automated email from the ASF dual-hosted git repository.

shuai pushed a change to branch fix/avatar-sha256
in repository https://gitbox.apache.org/repos/asf/incubator-answer.git


      at ddbd36e4 fix: gavatar use sha256 for hash

This branch includes the following new commits:

     new ddbd36e4 fix: gavatar use sha256 for hash

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



(incubator-answer) 01/01: fix: gavatar use sha256 for hash

Posted by sh...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

shuai pushed a commit to branch fix/avatar-sha256
in repository https://gitbox.apache.org/repos/asf/incubator-answer.git

commit ddbd36e4de6891011ceaded26406fcb8aa486092
Author: shuai <li...@sifou.com>
AuthorDate: Tue Aug 6 16:43:13 2024 +0800

    fix: gavatar use sha256 for hash
---
 ui/package.json                               |  2 +-
 ui/pnpm-lock.yaml                             | 30 +++++++--------------------
 ui/src/pages/Users/Settings/Profile/index.tsx |  4 ++--
 3 files changed, 10 insertions(+), 26 deletions(-)

diff --git a/ui/package.json b/ui/package.json
index 19e66981..8a087428 100644
--- a/ui/package.json
+++ b/ui/package.json
@@ -31,9 +31,9 @@
     "diff": "^5.1.0",
     "front-matter": "^4.0.2",
     "i18next": "^21.9.0",
+    "js-sha256": "0.11.0",
     "lodash": "^4.17.21",
     "marked": "^4.0.19",
-    "md5": "^2.3.0",
     "next-share": "^0.18.1",
     "qrcode": "^1.5.1",
     "qs": "^6.11.0",
diff --git a/ui/pnpm-lock.yaml b/ui/pnpm-lock.yaml
index b855bfa0..77bbee2d 100644
--- a/ui/pnpm-lock.yaml
+++ b/ui/pnpm-lock.yaml
@@ -53,15 +53,15 @@ importers:
       i18next:
         specifier: ^21.9.0
         version: 21.9.2
+      js-sha256:
+        specifier: 0.11.0
+        version: 0.11.0
       lodash:
         specifier: ^4.17.21
         version: 4.17.21
       marked:
         specifier: ^4.0.19
         version: 4.1.0
-      md5:
-        specifier: ^2.3.0
-        version: 2.3.0
       next-share:
         specifier: ^0.18.1
         version: 0.18.1(react-dom@18.2.0)(react-scripts@5.0.1)(react@18.2.0)
@@ -4642,10 +4642,6 @@ packages:
     resolution: {integrity: sha512-oSvEeo6ZUD7NepqAat3RqoucZ5SeqLJgOvVIwkafu6IP3V0pO38s/ypdVUmDDK6qIIHNlYHJAKX9E7R7HoKElw==}
     engines: {node: '>=12.20'}
 
-  /charenc@0.0.2:
-    resolution: {integrity: sha512-yrLQ/yVUFXkzg7EDQsPieE/53+0RlaWTs+wBrvW36cyilJ2SaDWfl4Yj7MtLTXleV9uEKefbAGUPv2/iWSooRA==}
-    dev: false
-
   /check-types@11.1.2:
     resolution: {integrity: sha512-tzWzvgePgLORb9/3a0YenggReLKAIb2owL03H2Xdoe5pKcUyWRSEQ8xfCar8t2SIAuEDwtmx2da1YB52YuHQMQ==}
 
@@ -4977,10 +4973,6 @@ packages:
       shebang-command: 2.0.0
       which: 2.0.2
 
-  /crypt@0.0.2:
-    resolution: {integrity: sha512-mCxBlsHFYh9C+HVpiEacem8FEBnMXgU9gy4zmNC+SXAZNB/1idgp/aulFJ4FgCi7GPEVbfyng092GqL2k2rmow==}
-    dev: false
-
   /crypto-random-string@2.0.0:
     resolution: {integrity: sha512-v1plID3y9r/lPhviJ1wrXpLeyUIGAZ2SHNYTEapm7/8A9nLPoyvVp3RK/EPFqn5kEznyWgYZNsRtYYIWbuG8KA==}
     engines: {node: '>=8'}
@@ -7207,10 +7199,6 @@ packages:
       call-bind: 1.0.5
       has-tostringtag: 1.0.0
 
-  /is-buffer@1.1.6:
-    resolution: {integrity: sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==}
-    dev: false
-
   /is-callable@1.2.6:
     resolution: {integrity: sha512-krO72EO2NptOGAX2KYyqbP9vYMlNAXdB53rq6f8LXY6RY7JdSR/3BD6wLUlPHSAesmY9vstNrjvqGaCiRK/91Q==}
     engines: {node: '>= 0.4'}
@@ -8017,6 +8005,10 @@ packages:
       - ts-node
       - utf-8-validate
 
+  /js-sha256@0.11.0:
+    resolution: {integrity: sha512-6xNlKayMZvds9h1Y1VWc0fQHQ82BxTXizWPEtEeGvmOUYpBRy4gbWroHLpzowe6xiQhHpelCQiE7HEdznyBL9Q==}
+    dev: false
+
   /js-tokens@4.0.0:
     resolution: {integrity: sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==}
 
@@ -8362,14 +8354,6 @@ packages:
     hasBin: true
     dev: false
 
-  /md5@2.3.0:
-    resolution: {integrity: sha512-T1GITYmFaKuO91vxyoQMFETst+O71VUPEU3ze5GNzDm0OWdP8v1ziTaAEPUr/3kLsY3Sftgz242A1SetQiDL7g==}
-    dependencies:
-      charenc: 0.0.2
-      crypt: 0.0.2
-      is-buffer: 1.1.6
-    dev: false
-
   /mdn-data@2.0.14:
     resolution: {integrity: sha512-dn6wd0uw5GsdswPFfsgMp5NSB0/aDe6fK94YJV/AJDYXL6HVLWBsxeq7js7Ad+mU2K9LAlwpk6kN2D5mwCPVow==}
 
diff --git a/ui/src/pages/Users/Settings/Profile/index.tsx b/ui/src/pages/Users/Settings/Profile/index.tsx
index ab2ee0f1..9af28ce6 100644
--- a/ui/src/pages/Users/Settings/Profile/index.tsx
+++ b/ui/src/pages/Users/Settings/Profile/index.tsx
@@ -21,7 +21,7 @@ import React, { FormEvent, useState, useEffect } from 'react';
 import { Form, Button, Stack, ButtonGroup } from 'react-bootstrap';
 import { Trans, useTranslation } from 'react-i18next';
 
-import MD5 from 'md5';
+import { sha256 } from 'js-sha256';
 
 import type { FormDataType } from '@/common/interface';
 import { UploadImg, Avatar, Icon, ImgViewer } from '@/components';
@@ -273,7 +273,7 @@ const Index: React.FC = () => {
       setFormData({ ...formData });
       if (res.e_mail) {
         const str = res.e_mail.toLowerCase().trim();
-        const hash = MD5(str);
+        const hash = sha256(str);
         setMailHash(hash);
       }
     });