In #39 we introduced an ID generator that we use to add the aria-labelled-by attribute to the SVG root element containing compounded digest values that match the title and desc elements' id attributes. E.g.
The ID values are generated based on either the existing ID of the element and its text, or a generic string (title or desc) and the element's text value. The values are deterministic, which leads to elements with duplicate IDs if the same SVG is added to a page multiple times.
This branch adds randomness (SecureRandom) to the IdGenerator class, to effectively reduce the likelihood of ID collision to zero.
/cc @tysongach for you input on the original feature
/cc @sonniesedge for reporting the issue
Fixes #76.
In #39 we introduced an ID generator that we use to add the
aria-labelled-by
attribute to the SVG root element containing compounded digest values that match thetitle
anddesc
elements'id
attributes. E.g.The ID values are generated based on either the existing ID of the element and its text, or a generic string (
title
ordesc
) and the element's text value. The values are deterministic, which leads to elements with duplicate IDs if the same SVG is added to a page multiple times.This branch adds randomness (
SecureRandom
) to theIdGenerator
class, to effectively reduce the likelihood of ID collision to zero./cc @tysongach for you input on the original feature /cc @sonniesedge for reporting the issue