From 8e2cea8690b44af6c66ddb786110a639013d0769 Mon Sep 17 00:00:00 2001 From: Yarmo Mackenbach Date: Tue, 19 Jan 2021 23:51:17 +0100 Subject: [PATCH] Remove obsolete function --- static/scripts.js | 30 ------------------------------ 1 file changed, 30 deletions(-) diff --git a/static/scripts.js b/static/scripts.js index 5e847ca..5e6a14c 100644 --- a/static/scripts.js +++ b/static/scripts.js @@ -1020,36 +1020,6 @@ async function fetchKeys(opts) { return output; } -function encodeZBase32(data) { - // Source: https://github.com/openpgpjs/openpgpjs/blob/master/src/util.js - if (data.length === 0) { - return ""; - } - const ALPHABET = "ybndrfg8ejkmcpqxot1uwisza345h769"; - const SHIFT = 5; - const MASK = 31; - let buffer = data[0]; - let index = 1; - let bitsLeft = 8; - let result = ''; - while (bitsLeft > 0 || index < data.length) { - if (bitsLeft < SHIFT) { - if (index < data.length) { - buffer <<= 8; - buffer |= data[index++] & 0xff; - bitsLeft += 8; - } else { - const pad = SHIFT - bitsLeft; - buffer <<= pad; - bitsLeft += pad; - } - } - bitsLeft -= SHIFT; - result += ALPHABET[MASK & (buffer >> bitsLeft)]; - } - return result; -} - async function computeWKDLocalPart(message) { const data = openpgp.util.str_to_Uint8Array(message); const hash = await openpgp.crypto.hash.sha1(data);