forked from Mirrors/keyoxide-web
Improve WKD local part compute
This commit is contained in:
parent
0a72efc291
commit
4018ec1c7b
1 changed files with 3 additions and 4 deletions
|
@ -776,10 +776,9 @@ function encodeZBase32(data) {
|
||||||
}
|
}
|
||||||
|
|
||||||
async function computeWKDLocalPart(message) {
|
async function computeWKDLocalPart(message) {
|
||||||
const encoder = new TextEncoder();
|
const data = openpgp.util.str_to_Uint8Array(message);
|
||||||
const data = encoder.encode(message);
|
const hash = await openpgp.crypto.hash.sha1(data);
|
||||||
const hash = await crypto.subtle.digest('SHA-1', data);
|
return openpgp.util.encodeZBase32(hash);
|
||||||
return encodeZBase32(new Uint8Array(hash));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async function generateProfileURL(data) {
|
async function generateProfileURL(data) {
|
||||||
|
|
Loading…
Reference in a new issue