hex plus plus

This commit is contained in:
Jesse-Ma
2023-03-31 10:21:44 +08:00
parent f369e59f6f
commit 8e6ce23b98
7 changed files with 97 additions and 56 deletions

View File

@@ -1,8 +1,9 @@
import axios from "axios";
import { getStoreKey } from "@/api/lock";
import storage from "@/libs/storage";
import { md5, wrap,convertBase64ToHexString,convertHexStringToUint8Array} from "@/libs/secret";
import { md5, wrap} from "@/libs/secret";
import NoteConstant from "@/libs/constants";
import { Buffer } from 'buffer';
axios.interceptors.response.use(undefined, (err) => {
const { config: originalRequest } = err;
@@ -48,14 +49,7 @@ export function saveNote(noteForm, secret) {
});
}
// let bufferArrary = eval("[" + note.text + "]");
// let array = Uint8Array.from(bufferArrary);
// let encoder = new TextEncoder()
// let array = encoder.encode(note.text)
let hexString = convertBase64ToHexString(note.text)
let array = convertHexStringToUint8Array(hexString)
let array = Buffer.from(note.text, 'base64')
let blob = new Blob([array], { type: "application/octet-stream" });
let form = new FormData();