Skip to content

Commit e63ea8e

Browse files
committed
Replace crypto-browserify with simple js-md5
1 parent ff87f80 commit e63ea8e

File tree

7 files changed

+17
-312
lines changed

7 files changed

+17
-312
lines changed

webapp/cypress/component/UserBubbleLoginTest.cy.jsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
11
import { createStore } from "vuex";
22
import UserBubbleLogin from "@/components/UserBubbleLogin.vue";
33
import NotificationDot from "@/components/NotificationDot.vue";
4-
import crypto from "crypto";
4+
import { md5 } from "js-md5";
55

66
describe("UserBubbleLogin", () => {
7-
const md5 = (value) => crypto.createHash("md5").update(value).digest("hex");
8-
97
const creator = {
108
contact_email: "[email protected]",
119
display_name: "Test User",

webapp/cypress/component/UserBubbleTest.cy.jsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
import UserBubble from "@/components/UserBubble.vue";
2-
import crypto from "crypto";
2+
import { md5 } from "js-md5";
33

44
describe("UserBubble", () => {
5-
const md5 = (value) => crypto.createHash("md5").update(value).digest("hex");
6-
75
const creator = {
86
contact_email: "[email protected]",
97
display_name: "Test User",

webapp/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
"@vueuse/components": "^10.7.2",
2626
"bootstrap": "^4.5.3",
2727
"buffer": "^6.0.3",
28-
"crypto-browserify": "^3.12.0",
2928
"cytoscape": "^3.23.0",
3029
"cytoscape-cola": "^2.5.1",
3130
"cytoscape-elk": "^2.1.0",
@@ -35,6 +34,7 @@
3534
"highlight.js": "^11.7.0",
3635
"markdown-it": "^13.0.1",
3736
"mermaid": "^10.1.0",
37+
"js-md5": "^0.8.3",
3838
"primeicons": "^7.0.0",
3939
"primevue": "^4.0.0",
4040
"process": "^0.11.10",

webapp/src/components/UserBubble.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
</template>
1717

1818
<script>
19-
import crypto from "crypto";
19+
import { md5 } from "js-md5";
2020
import { GRAVATAR_STYLE } from "@/resources.js";
2121
export default {
2222
props: {
@@ -38,7 +38,7 @@ export default {
3838
methods: {
3939
md5(value) {
4040
// Returns the MD5 hash of the given string.
41-
return crypto.createHash("md5").update(value).digest("hex");
41+
return md5(value);
4242
},
4343
},
4444
};

webapp/src/components/UserBubbleLogin.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,12 @@
1717
</template>
1818

1919
<script>
20-
import crypto from "crypto";
2120
import { GRAVATAR_STYLE } from "@/resources.js";
2221
2322
import NotificationDot from "./NotificationDot.vue";
2423
2524
import { getUsersList } from "@/server_fetch_utils.js";
25+
import { md5 } from "js-md5";
2626
2727
export default {
2828
components: {
@@ -57,7 +57,7 @@ export default {
5757
methods: {
5858
md5(value) {
5959
// Returns the MD5 hash of the given string.
60-
return crypto.createHash("md5").update(value).digest("hex");
60+
return md5(value);
6161
},
6262
},
6363
};

webapp/vue.config.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ module.exports = {
44
transpileDependencies: ["mermaid"],
55
configureWebpack: (config) => {
66
config.resolve.fallback = {
7-
crypto: require.resolve("crypto-browserify"),
87
stream: require.resolve("stream-browserify"),
98
process: require.resolve("process/browser"),
109
buffer: require.resolve("buffer/"),

0 commit comments

Comments
 (0)