apple / swift-asn1

An implementation of ASN.1 for Swift
https://swiftpackageindex.com/apple/swift-asn1/main/documentation/swiftasn1
Apache License 2.0
137 stars 27 forks source link

Add method to lazily parse a `SET` from a ASN1Node #32

Closed dnadoba closed 1 year ago

dnadoba commented 1 year ago

Motiviation

We want reduce allocations in swift-certificates and need a way to parse without allocating an intermediate Array.

Modifications

add DER.lazySet(of:identifier:rootNode) which returns its result without allocating.

Result

We can eliminate allocations during parsing