add SendUsrChk and test it

This commit is contained in:
DavidVentura
2024-01-25 10:09:41 +01:00
parent 723384b89a
commit 957a4b5cab
4 changed files with 29 additions and 4 deletions
+2 -2
View File
@@ -7,7 +7,7 @@ const str2byte = (s: string): number[] => {
return Array.from(s).map((_, i) => s.charCodeAt(i));
};
const SendUsrChk = (username: string, password: string): DataView => {
export const SendUsrChk = (username: string, password: string): DataView => {
// type is char account[0x20]; char password[0x80];
let buf = new Uint8Array(0x20 + 0x80);
buf.fill(0);
@@ -40,4 +40,4 @@ const SendUsrChk = (username: string, password: string): DataView => {
return retret;
};
console.log(hexdump(SendUsrChk("admin", "admin").buffer, { ansi: true }));
//console.log(hexdump(SendUsrChk("admin", "admin").buffer, { ansi: true }));