Khrisna commited on
Commit
b96b581
·
verified ·
1 Parent(s): 333b533

Update lib/diffusion.js

Browse files
Files changed (1) hide show
  1. lib/diffusion.js +14 -1
lib/diffusion.js CHANGED
@@ -10,7 +10,20 @@
10
  */
11
 
12
  import WebSocket from "ws";
13
- import { createHash } from "hash-generator";
 
 
 
 
 
 
 
 
 
 
 
 
 
14
 
15
  const generateHash = () => {
16
  let m = createHash(12);
 
10
  */
11
 
12
  import WebSocket from "ws";
13
+
14
+
15
+ function createHash(length) {
16
+ var chars = 'abcdefghijklmnopqrstuvwxyz0123456789';
17
+ var text = '';
18
+
19
+ length = length || 6;
20
+
21
+ for (var i = 0; i < length; i++) {
22
+ text += chars.charAt(Math.floor(Math.random() * chars.length));
23
+ }
24
+
25
+ return text;
26
+ }
27
 
28
  const generateHash = () => {
29
  let m = createHash(12);