This commit is contained in:
rustdesk
2022-01-19 00:57:57 +08:00
parent 9f42fd534c
commit d7d4b46c46
3 changed files with 13 additions and 0 deletions

View File

@@ -1,5 +1,6 @@
import * as message from "./message.js";
import * as rendezvous from "./rendezvous.js";
import * as sha256 from "fast-sha256";
type Keys = "message" | "open" | "close" | "error";
@@ -76,4 +77,10 @@ export default class Websock {
let bytes = new Uint8Array(e.data);
}
}
hash(datas: [Uint8Array]): Uint8Array {
const hasher = new sha256.Hash();
datas.forEach((data) => hasher.update(data));
return hasher.digest();
}
}