mirror of
https://git.um-react.app/um/um-react.git
synced 2026-11-25 14:56:58 +00:00
refactor: slice NCM parsing
This commit is contained in:
1 parent
bb9529b877
commit
8b628fd6ce
1 file changed
+6
-1
@@ -8,8 +8,13 @@ export class NCMCrypto implements CryptoBase {
|
||||
ncm = new NCMFile();
|
||||
|
||||
async checkBySignature(buffer: ArrayBuffer) {
|
||||
const data = new Uint8Array(buffer);
|
||||
let len = 1024;
|
||||
try {
|
||||
this.ncm.open(new Uint8Array(buffer));
|
||||
while (len !== 0) {
|
||||
console.debug('NCM/open: read %d bytes', len);
|
||||
len = this.ncm.open(data.subarray(0, len));
|
||||
}
|
||||
} catch (error) {
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user