LCOV - code coverage report
Current view: top level - lib/src/device_info - vendor_table.dart (source / functions) Coverage Total Hit
Test: lcov.info Lines: 100.0 % 5 5
Test Date: 2026-11-15 16:52:47 Functions: - 0 0

            Line data    Source code
       1              : /// Provides utilities for normalizing MAC addresses for vendor lookup.
       2              : class VendorTable {
       3              :   /// Hex lengths of the IEEE assignment blocks, most specific first: MA-S and
       4              :   /// IAB (4.5 octets), MA-M (3.5 octets), then MA-L (3 octets).
       5              :   static const List<int> prefixLengths = [9, 7, 6];
       6              : 
       7              :   /// Normalizes a MAC address to upper-case hex with no separators.
       8              :   ///
       9              :   /// Accepts colon, dash and dot separated MACs as well as raw hex strings.
      10            2 :   static String normalizedHex(String macAddress) =>
      11            6 :       macAddress.replaceAll(RegExp('[^0-9a-fA-F]'), '').toUpperCase();
      12              : 
      13              :   /// Normalizes a MAC address to its upper-case, separator-free MA-L prefix.
      14              :   ///
      15              :   /// Returns the whole input when it is shorter than 3 octets. Use
      16              :   /// [normalizedHex] when the full address is needed, since MA-M, MA-S and IAB
      17              :   /// blocks are longer than 6 characters.
      18            1 :   static String noColonString(String macAddress) {
      19            1 :     final String hex = normalizedHex(macAddress);
      20            3 :     return hex.length > 6 ? hex.substring(0, 6) : hex;
      21              :   }
      22              : }
        

Generated by: LCOV version 2.0-1