wasm 加密
This commit is contained in:
@@ -1,7 +1,8 @@
|
||||
import CryptoJS from "crypto-js";
|
||||
import pako from "pako";
|
||||
import {gzip_encode_raw,gzip_decode_raw} from 'wasm-flate';
|
||||
//import {gzip_encode_raw,gzip_decode_raw} from 'wasm-flate';
|
||||
|
||||
const wasmFlate = window.wasm_bindgen;
|
||||
|
||||
/**
|
||||
* @word 要加密的内容
|
||||
@@ -80,16 +81,18 @@ export function noteZip(text) {
|
||||
}
|
||||
|
||||
function zip(data){
|
||||
if(gzip_encode_raw){
|
||||
return gzip_encode_raw(data);
|
||||
}
|
||||
if(wasmFlate.__wbindgen_wasm_module){
|
||||
return wasmFlate.gzip_encode_raw(data);
|
||||
}
|
||||
|
||||
return pako.gzip(data);
|
||||
}
|
||||
|
||||
function unzip(data){
|
||||
if(gzip_decode_raw){
|
||||
return gzip_decode_raw(data);
|
||||
if(wasmFlate.__wbindgen_wasm_module){
|
||||
return wasmFlate.gzip_decode_raw(data);
|
||||
}
|
||||
|
||||
return pako.ungzip(data);
|
||||
}
|
||||
|
||||
|
||||
@@ -295,6 +295,8 @@ export default {
|
||||
|
||||
this.bindCtrlAllEvent();
|
||||
this.bindToTopEvent();
|
||||
|
||||
window.wasm_bindgen(window.wasm_flate_bg_path);
|
||||
},
|
||||
mounted() {
|
||||
const myObserver = new ResizeObserver(entries => {
|
||||
|
||||
Reference in New Issue
Block a user