fingerprint property

String fingerprint
latefinal

Identifies what this vector does to the arithmetic: the mode, scale, range and the directions of the layers it steers. Equal for vectors that steer identically.

Implementation

late final String fingerprint = () {
  final layers = _applied.keys.where(steers).toList()..sort();
  final out = BytesBuilder(copy: false);
  final scalar = ByteData(8)..setFloat64(0, scale, Endian.little);
  out
    ..add('${mode.name} ${layers.join(',')} '.codeUnits)
    ..add(scalar.buffer.asUint8List());
  for (final l in layers) {
    final d = directions[l]!;
    out.add(d.buffer.asUint8List(d.offsetInBytes, d.lengthInBytes));
  }
  return sha256.convert(out.takeBytes()).toString();
}();