From 3bd78f5d7a4b5635f3d60bfa3931a8012b5c9732 Mon Sep 17 00:00:00 2001
From: Giovanni Caruso <gc4117@cloud-vm-36-76.doc.ic.ac.uk>
Date: Thu, 14 Nov 2019 18:51:20 +0000
Subject: [PATCH] Changed humanhash to HumanHasher

---
 src/app.js | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/app.js b/src/app.js
index f96d2a1..182e957 100644
--- a/src/app.js
+++ b/src/app.js
@@ -7,6 +7,7 @@ import * as canvas from "./canvas.js"
 import * as HTML from "./elements.js"
 import { connect } from "./room.js"
 import * as toolSelection from "./tool-selection.js"
+import * as humanhash from "humanhash"
 
 const TEST_ROOM = "imperial"
 
@@ -31,6 +32,8 @@ const getPressureFactor = (pressure) => {
 
 let room = null
 
+const humanHasher = new humanhash()
+
 const onRoomConnect = (room_) => {
   room = room_
 
@@ -179,8 +182,7 @@ const getOrInsertPeerById = (id) => {
 
   peerId.id = id
 
-  const humanhash = new (require("humanhash"))()
-  peerId.innerHTML = humanhash.humanize(id, 2)
+  peerId.innerHTML = humanHasher.humanize(id, 2)
 
   peerElem.appendChild(avatarImage)
   peerElem.appendChild(quality)
-- 
GitLab