Remove obsolete function

This commit is contained in:
Yarmo Mackenbach 2021-01-19 23:51:17 +01:00
parent cfab181316
commit 8e2cea8690
No known key found for this signature in database
GPG key ID: 37367F4AF4087AD1

View file

@ -1020,36 +1020,6 @@ async function fetchKeys(opts) {
return output; 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) { async function computeWKDLocalPart(message) {
const data = openpgp.util.str_to_Uint8Array(message); const data = openpgp.util.str_to_Uint8Array(message);
const hash = await openpgp.crypto.hash.sha1(data); const hash = await openpgp.crypto.hash.sha1(data);