readBinaryXml static method

KdbxBinary readBinaryXml(
  1. XmlElement valueNode, {
  2. required bool isInline,
})

Implementation

static KdbxBinary readBinaryXml(XmlElement valueNode,
    {required bool isInline}) {
  final isProtected = valueNode.getAttributeBool(KdbxXml.ATTR_PROTECTED);
  final isCompressed = valueNode.getAttributeBool(KdbxXml.ATTR_COMPRESSED);
  var value = base64.decode(valueNode.text.trim());
  if (isCompressed) {
    value = gzip.decode(value) as Uint8List;
  }
  return KdbxBinary(
    isInline: isInline,
    isProtected: isProtected,
    value: value,
  );
}