diff --git a/src/interfaces/ISolidFile.ts b/src/interfaces/ISolidFile.ts index 0eb9cf8..fe6fbe8 100644 --- a/src/interfaces/ISolidFile.ts +++ b/src/interfaces/ISolidFile.ts @@ -10,7 +10,7 @@ interface ISolidFileInfo { files: ISolidFile[]; /** Length of one piece in bytes, e.g. 65536 for 64 KiB, and 4194304 for 4 MiB. */ 'piece length': 65536 | 4194304; - /** Concatenated hashes of all pieces. */ + /** Concatenated SHA1 hashes of all pieces, where each hash is 20 bytes long. */ pieces: string; /** Whether the torrent is private, always 0. */ private: 0 | 1; diff --git a/src/ssn/extractFile.ts b/src/ssn/extractFile.ts index 021227f..ec7f7e4 100644 --- a/src/ssn/extractFile.ts +++ b/src/ssn/extractFile.ts @@ -31,6 +31,7 @@ export default async function extractFile(file: ISsnFileEntry, dvArray: DataView //Uncompress file const uncompressedBuffer: Buffer = await new Promise((resolve, reject) => { + console.log(new Uint8Array(dvFinal.buffer)); zlib.inflateRaw(dvFinal, (error, result) => { if (error !== null) { return reject(error); diff --git a/src/ssn/verifySolidpkg.ts b/src/ssn/verifySolidpkg.ts index d2ae425..3006beb 100644 --- a/src/ssn/verifySolidpkg.ts +++ b/src/ssn/verifySolidpkg.ts @@ -1,6 +1,6 @@ import ISolid from '../interfaces/ISolidFile'; -/** Verifies metafile.solid for correctness. */ +/** Verifies metafile.solid for correctness. See specification at . */ export default function verifySolidpkg(file: ISolid, { product, from, to }: {product: string, from: number, to: number}) { if (typeof file['creation date'] !== 'number') { throw new Error(`Expected creation date to be a number but it was "${file['creation date']}".`);