Open Manouchehri opened 1 year ago
Would it be possible to have things like AsnParser.parse(...) support ReadableStream as the data BufferSource?
AsnParser.parse(...)
ReadableStream
e.g.
import { AsnParser } from "@peculiar/asn1-schema"; import { Certificate } from "@peculiar/asn1-x509"; fetch("https://raw.githubusercontent.com/google/clusterfuzz/master/docs/setting-up-fuzzing/heartbleed/server.pem").then(async current_response => { const cert = AsnParser.parse(current_response.body, Certificate); console.log(cert); })
instead of:
import { AsnParser } from "@peculiar/asn1-schema"; import { Certificate } from "@peculiar/asn1-x509"; fetch("https://raw.githubusercontent.com/google/clusterfuzz/master/docs/setting-up-fuzzing/heartbleed/server.pem").then(async current_response => { const cert = AsnParser.parse(await current_response.arrayBuffer(), Certificate); console.log(cert); })
While this simplified example only has a tiny certificate, I think ReadableStream would help reduce memory and decoding times for very large BER buffers.
Would it be possible to have things like
AsnParser.parse(...)
supportReadableStream
as the data BufferSource?e.g.
instead of:
While this simplified example only has a tiny certificate, I think
ReadableStream
would help reduce memory and decoding times for very large BER buffers.