From 4d4a418a95634921709b23bd5644e0e8a2529649 Mon Sep 17 00:00:00 2001 From: Kevin R Date: Wed, 19 Aug 2020 23:54:08 +0200 Subject: [PATCH] Update utils.ts --- source/utils/utils.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/source/utils/utils.ts b/source/utils/utils.ts index 58f1141..4deebc8 100644 --- a/source/utils/utils.ts +++ b/source/utils/utils.ts @@ -22,10 +22,10 @@ */ import { browser } from 'webextension-polyfill-ts' -// Needed by the sha256 method -const enc = new TextEncoder() - export class Utils { + // Needed by the sha256 method + static enc = new TextEncoder() + /** * Checks if the current browser runs on android. * @@ -88,7 +88,7 @@ export class Utils { * @returns SHA-256 of the given message */ static async sha256(message: string): Promise { - const msgUint8 = enc.encode(message) + const msgUint8 = Utils.enc.encode(message) const hashBuffer = await crypto.subtle.digest('SHA-256', msgUint8) const hashArray = Array.from(new Uint8Array(hashBuffer))