The 1.1.0 release included a patch (#154) that supported converting RDNAttribute values into strings. This patch missed that the .any case may also have strings in it.
While investigating this limitation, @Lukasa realised that the constructor function was excessively complex. While it attempted to coerce based on extra information in the ASN.1 specification, it always fell back into the .any case. This meant that as a practical matter we always took the same few paths, and so could safely simplify the code.
Modifications
Simplify DER decoding of RDNAttribute.Values
Normalise internal storage to guarantee that .any can never contain bytes which are equal to the DER representation of .printable or .utf8.
The above invariant allows us to use the synthesised Hashable implementation which in turn allows to delete the custom Hashable implementation
Result
Faster construction, normalised representation, less code.
Motivation
The 1.1.0 release included a patch (#154) that supported converting RDNAttribute values into strings. This patch missed that the
.any
case may also have strings in it.While investigating this limitation, @Lukasa realised that the constructor function was excessively complex. While it attempted to coerce based on extra information in the ASN.1 specification, it always fell back into the
.any
case. This meant that as a practical matter we always took the same few paths, and so could safely simplify the code.Modifications
.any
can never contain bytes which are equal to the DER representation of.printable
or.utf8
.Hashable
implementationResult
Faster construction, normalised representation, less code.