removed unneeded uint8array conversion

This commit is contained in:
uh wot 2021-07-17 15:39:30 +02:00
parent 1efa8a0a55
commit 2a3cec050b
Signed by: uhwot
GPG Key ID: CB2454984587B781
2 changed files with 4 additions and 4 deletions

2
dist/worker.js vendored

File diff suppressed because one or more lines are too long

View File

@ -9,9 +9,9 @@ addEventListener('fetch', event => {
const AESKEY = [106, 111, 54, 97, 101, 121, 54, 104, 97, 105, 100, 50, 84, 101, 105, 104]
function str2bin(str) {
return new Uint8Array(Array.from(str).map(function (item) {
return Array.from(str).map(function (item) {
return item.charCodeAt(0);
}))
})
}
async function url_gen(md5_origin, format, id, media_version) {
@ -19,7 +19,7 @@ async function url_gen(md5_origin, format, id, media_version) {
let result = [md5_origin, format, id, media_version].join('\xa4')
let result_md5 = await crypto.subtle.digest('MD5', str2bin(result))
let result_md5 = await crypto.subtle.digest('MD5', new Uint8Array(str2bin(result)))
result_md5 = aesjs.utils.hex.fromBytes(new Uint8Array(result_md5))