> ## Documentation Index
> Fetch the complete documentation index at: https://docs.fin-observe.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Listdata calculator

> Parameter decoding listdata

export const BitCalculatorEN = () => {
  const [decimalValue, setDecimalValue] = useState(0);
  const [selectedBits, setSelectedBits] = useState(new Set());
  const BIT_DATA = [{
    bit: 0,
    value: 1,
    name: 'SFMS',
    block: 'psanctions',
    register: 'Sanctions and Warnings Register'
  }, {
    bit: 1,
    value: 2,
    name: 'NSDC',
    block: 'psanctions',
    register: 'Sanctions and Warnings Register'
  }, {
    bit: 2,
    value: 4,
    name: 'UN',
    block: 'psanctions',
    register: 'Sanctions and Warnings Register'
  }, {
    bit: 3,
    value: 8,
    name: 'European Union',
    block: 'psanctions',
    register: 'Sanctions and Warnings Register'
  }, {
    bit: 4,
    value: 16,
    name: 'United Kingdom',
    block: 'psanctions',
    register: 'Sanctions and Warnings Register'
  }, {
    bit: 5,
    value: 32,
    name: 'USA',
    block: 'psanctions',
    register: 'Sanctions and Warnings Register'
  }, {
    bit: 6,
    value: 64,
    name: 'Canada',
    block: 'psanctions',
    register: 'Sanctions and Warnings Register'
  }, {
    bit: 7,
    value: 128,
    name: 'Other foreign sanctions lists',
    block: 'psanctions',
    register: 'Sanctions and Warnings Register'
  }, {
    bit: 8,
    value: 256,
    name: 'Notaries',
    block: 'notarius',
    register: 'Notaries Register'
  }, {
    bit: 9,
    value: 512,
    name: 'National Politically Exposed Persons',
    block: 'pep',
    register: 'Politically Exposed Persons Register'
  }, {
    bit: 10,
    value: 1024,
    name: 'International Organization PEPs',
    block: 'pep',
    register: 'Politically Exposed Persons Register'
  }, {
    bit: 11,
    value: 2048,
    name: 'Foreign Politically Exposed Persons',
    block: 'pep',
    register: 'Politically Exposed Persons Register'
  }, {
    bit: 12,
    value: 4096,
    name: 'Close and related to public persons',
    block: 'pep',
    register: 'Politically Exposed Persons Register'
  }, {
    bit: 13,
    value: 8192,
    name: 'Traitors and occupiers',
    block: 'zrada/okupant',
    register: 'Traitors / Occupiers Register'
  }, {
    bit: 14,
    value: 16384,
    name: 'Tax non-residents',
    block: 'nonrezedent',
    register: 'Non-Residents Register'
  }, {
    bit: 15,
    value: 32768,
    name: 'Lost national and foreign passports',
    block: 'lostdoc',
    register: 'Lost Documents Register'
  }, {
    bit: 16,
    value: 65536,
    name: 'Enforcement proceedings',
    block: 'executive',
    register: 'Enforcement Proceedings Register'
  }, {
    bit: 17,
    value: 131072,
    name: 'Debtors',
    block: 'taxdebtor/debtor',
    register: 'Debtors Register'
  }, {
    bit: 18,
    value: 262144,
    name: 'Reserve',
    block: '',
    register: ''
  }, {
    bit: 19,
    value: 524288,
    name: 'Bankrupts',
    block: 'bankrupt',
    register: 'Bankrupts Register'
  }, {
    bit: 20,
    value: 1048576,
    name: 'Affiliation with a legal entity',
    block: 'edr',
    register: 'Legal Entities and Entrepreneurs Register'
  }, {
    bit: 21,
    value: 2097152,
    name: 'Reserve',
    block: '',
    register: ''
  }, {
    bit: 22,
    value: 4194304,
    name: 'Legal entity information from EDR',
    block: 'edrfullinfo',
    register: 'Legal Entities and Entrepreneurs Register'
  }, {
    bit: 23,
    value: 8388608,
    name: 'EDR changes (legal form / name)',
    block: 'edrchanges',
    register: 'Legal Entities and Entrepreneurs Register'
  }, {
    bit: 24,
    value: 16777216,
    name: 'EDR changes (address)',
    block: 'edrchanges',
    register: 'Legal Entities and Entrepreneurs Register'
  }, {
    bit: 25,
    value: 33554432,
    name: 'EDR changes (director)',
    block: 'edrchanges',
    register: 'Legal Entities and Entrepreneurs Register'
  }, {
    bit: 26,
    value: 67108864,
    name: 'EDR changes (NACE)',
    block: 'edrchanges',
    register: 'Legal Entities and Entrepreneurs Register'
  }, {
    bit: 27,
    value: 134217728,
    name: 'EDR changes (status)',
    block: 'edrchanges',
    register: 'Legal Entities and Entrepreneurs Register'
  }, {
    bit: 28,
    value: 268435456,
    name: 'EDR changes (UBO)',
    block: 'edrchanges',
    register: 'Legal Entities and Entrepreneurs Register'
  }, {
    bit: 29,
    value: 536870912,
    name: 'EDR changes (owner)',
    block: 'edrchanges',
    register: 'Legal Entities and Entrepreneurs Register'
  }, {
    bit: 30,
    value: 1073741824,
    name: 'Court cases',
    block: 'justice',
    register: 'Court Cases Register'
  }, {
    bit: 31,
    value: 2147483648,
    name: 'Licenses',
    block: 'license',
    register: 'Licenses Register'
  }, {
    bit: 32,
    value: 4294967296,
    name: 'Reserve',
    block: '',
    register: ''
  }, {
    bit: 33,
    value: 8589934592,
    name: 'Wanted persons',
    block: 'wanted',
    register: 'Wanted Persons Register'
  }, {
    bit: 34,
    value: 17179869184,
    name: 'Reserve',
    block: '',
    register: ''
  }, {
    bit: 35,
    value: 34359738368,
    name: 'Corruption offenses',
    block: 'corrupt',
    register: 'Corruption Offenders Register'
  }, {
    bit: 36,
    value: 68719476736,
    name: 'Reserve',
    block: '',
    register: ''
  }, {
    bit: 37,
    value: 137438953472,
    name: 'Warnings',
    block: 'psanctions',
    register: 'Sanctions and Warnings Register'
  }, {
    bit: 38,
    value: 274877906944,
    name: 'Related to sanctioned persons',
    block: 'psanctions',
    register: 'Sanctions and Warnings Register'
  }];
  const handleDecimalChange = e => {
    const value = parseInt(e.target.value) || 0;
    setDecimalValue(value);
    const bits = new Set();
    BIT_DATA.forEach(bit => {
      if ((value & bit.value) === bit.value) {
        bits.add(bit.bit);
      }
    });
    setSelectedBits(bits);
  };
  const handleBitChange = bit => {
    const newSelectedBits = new Set(selectedBits);
    if (newSelectedBits.has(bit)) {
      newSelectedBits.delete(bit);
    } else {
      newSelectedBits.add(bit);
    }
    setSelectedBits(newSelectedBits);
    let value = 0;
    newSelectedBits.forEach(b => {
      const bitData = BIT_DATA.find(item => item.bit === b);
      if (bitData) {
        value += bitData.value;
      }
    });
    setDecimalValue(value);
  };
  return <div className="bit-calculator .dark">
      
      <div className="calculator-container">
        <div className="input-section">
          <label htmlFor="decimal-input">Decimal number:</label>
          <input id="decimal-input" type="number" value={decimalValue} onChange={handleDecimalChange} placeholder="Enter a number" />
          <p className="decimal-display">Value: {decimalValue}</p>
        </div>

        <div className="table-section">
          <h2>Bit and Register Selection</h2>
          <table className="bits-table">
            <thead>
              <tr>
                <th className="checkbox-col">✓</th>
                <th>Bit</th>
                <th>Value</th>
                <th>Description</th>
                <th>Blocks</th>
                <th>Registers</th>
              </tr>
            </thead>
            <tbody>
              {BIT_DATA.map(bit => <tr key={bit.bit} className={`bit-row ${selectedBits.has(bit.bit) ? 'selected' : 'unselected'}`}>
                  <td className="checkbox-cell">
                    <input type="checkbox" id={`bit-${bit.bit}`} checked={selectedBits.has(bit.bit)} onChange={() => handleBitChange(bit.bit)} />
                  </td>
                  <td className="bit-col">{bit.bit}</td>
                  <td className="value-col">{bit.value}</td>
                  <td className="description-col">{bit.name}</td>
                  <td className="block-col">{bit.block ? <code>{bit.block}</code> : '—'}</td>
                  <td className="register-col">{bit.register || '—'}</td>
                </tr>)}
            </tbody>
          </table>
        </div>

        {selectedBits.size > 0 && <div className="summary-section">
            <h2>Selected Registers ({selectedBits.size})</h2>
            <div className="summary-content">
              <div className="summary-value">
                <span>Decimal value: </span>
                <strong>{decimalValue}</strong>
              </div>
              <div className="summary-list">
                {Array.from(selectedBits).sort((a, b) => a - b).map(bitIndex => {
    const bit = BIT_DATA.find(b => b.bit === bitIndex);
    return <div key={bitIndex} className="summary-item">
                        <span className="summary-bit">Bit {bitIndex} </span>
                        <span className="summary-name">{bit.name}</span>
                      </div>;
  })}
              </div>
            </div>
          </div>}
      </div>
    </div>;
};

<BitCalculatorEN />
