Introducing The Sweep: OX’s New Live Security Research Series
Register Now
Breaking: The 2026 Vulnpocalypse Hits PHP: Four Critical RCEs, but How Dangerous Are They?
Read the Report
Are you exposed? Connect your apps in minutes.
Scan your apps free

logic-gate-sim

Latest version: v1.0.1

Overview

Last scanned
23 Nov 2026
Published
23 Nov 2026
npm package Publisher: khorshedcodes
0 Stars
0 Forks
3 Versions
JavaScript Repo language

Scan summary

logic-gate-sim was last scanned on 23 Nov 2026 at version 1.0.1. Risk score 0 of 100. No malicious behavior was detected.

  • Releases: 3 versions, all published on 23 Nov 2026.
  • Findings: No rules fired in version 1.0.1.

Versions

3 versions published
Versions and the rules that fired in each
VersionPublishedStatus
1.0.1 LATEST 23 Nov 2026 No rules fired
1.0.0 23 Nov 2026 No rules fired
0.0.0-stage 23 Nov 2026 Not shown

No rules fired in 1.0.1

Findings

Findings for v1.0.1. The score is a capped sum of the weights of the rules that fired — not CVSS, not exploitability, and not a probability. It is not comparable across packages with different scan coverage.

The score describes 1.0.1; other versions have their own rules, not their own score.

README

The publisher’s own README, as collected from the registry.

logic-gate-sim

Zero-dependency digital logic gates, automatic truth table generator, and combinational circuit simulator for JavaScript and TypeScript.

Features

  • All Standard & Universal Gates: BUFFER, NOT, AND, OR, NAND, NOR, XOR, XNOR
  • Flexible Inputs: Accepts 1/0 or true/false, and supports 2 or more inputs on multi-input gates
  • Truth Table Generator: Automatically generates all $2^n$ combinations and outputs for any custom circuit function
  • Combinational Circuits: Built-in halfAdder and fullAdder
  • TypeScript Ready: Includes built-in .d.ts type definitions with zero external dependencies

Installation

npm install logic-gate-sim

Quick Start

const {
  BUFFER,
  NOT,
  AND,
  OR,
  NAND,
  NOR,
  XOR,
  XNOR,
  truthTable,
  halfAdder,
  fullAdder,
} = require("logic-gate-sim");

// 1. Evaluate logic gates (accepts 1/0 or true/false, supports 2+ inputs)
console.log(AND(1, 1, 1)); // 1
console.log(NAND(1, 1)); // 0
console.log(XOR(1, 0, 1)); // 0
console.log(NOT(true)); // 0

// 2. Generate a complete truth table for any custom circuit: (A AND B) OR (NOT C)
const table = truthTable(3, (a, b, c) => OR(AND(a, b), NOT(c)));
console.table(table);

// 3. Built-in Half Adder & Full Adder
console.log(halfAdder(1, 1)); // { sum: 0, carry: 1 }
console.log(fullAdder(1, 1, 1)); // { sum: 1, carryOut: 1 }

API Reference

Logic Gates

All gates return 0 or 1 and accept 0, 1, true, or false.

Function Description Example Output
BUFFER(a) Passes input bit unchanged BUFFER(1) 1
NOT(a) Inverts input bit NOT(1) 0
AND(...inputs) 1 if all inputs are 1 AND(1, 1, 0) 0
OR(...inputs) 1 if at least one input is 1 OR(0, 0, 1) 1
NAND(...inputs) Inverted AND NAND(1, 1) 0
NOR(...inputs) Inverted OR NOR(0, 0) 1
XOR(...inputs) 1 if an odd number of inputs are 1 XOR(1, 0, 1) 0
XNOR(...inputs) Inverted XOR XNOR(1, 1) 1
truthTable(numInputs, circuitFn)

Generates all $2^n$ input rows and evaluates circuitFn(...inputs) for each combination.

const xorTable = truthTable(2, (a, b) => XOR(a, b));
// [
//   { inputs: [0, 0], output: 0 },
//   { inputs: [0, 1], output: 1 },
//   { inputs: [1, 0], output: 1 },
//   { inputs: [1, 1], output: 0 }
// ]
Adders
  • halfAdder(a, b) → returns { sum, carry }
  • fullAdder(a, b, carryIn) → returns { sum, carryOut }

License

MIT

OX Radar and Response Center

Find threats in your stack.

OX Radar can check high-priority threats, like critical package CVEs, against your context.

Each incident is marked Detected or Not Detected with a remediation plan and proof all tracked in the Response Center.

Where it’s listed

The probe returned only these fields for this server — auth requirement, protocol and tool list weren’t observed, so they’re not shown (never guessed).

  • npm logic-gate-sim

References

The publisher’s own links, as the registry reports them. These are not sources for the assessment on this page.

Scan your whole stack

Group 1261154050 1
Group 1261154050
 

From OX Research Newsroom

Cry2Wolf: How to Tell a Real Bug from a Nothingburger
AI & VibeSec

Cry2Wolf: Not Every Branded Bug Deserves a Fire Drill

Vulnerability Insights

Compromised Claude Code extensions (versions 2.1.312 & 2.1.313) in Cursor try to install a backdoor

Vulnerability Insights

OpenSSH Password Authentication Bypass on Alpine Linux (*sshole) – CVE-2026-123158

Frame 2085668439 (1)
Group 1261154229