Hash.parse constructor

Hash.parse(
  1. XmlElement element
)

Factory method to create a new Hash instance from an XML element.

The factory constructor takes an XmlElement representing the "hash" element and extracts its attributes "algo" and value. It uses these values to initialize the properties of the Hash object.

Implementation

factory Hash.parse(XmlElement element) {
  return Hash(
    algo: element
        .getAttribute('algo'), // Get the value of the "algo" attribute.
    value: element.innerText, // Get the inner text of the "hash" element.
  );
}