
Company News
Andrew Becherer Joins Socket as Chief Information Security Officer
Socket’s first CISO brings deep experience securing high-growth SaaS companies as open source supply chain threats accelerate.
Mathematics of Incan knotted cord (quipu) data structures for JavaScript/TypeScript
Mathematics of Incan knotted cord (quipu) data structures for JavaScript/TypeScript.
Quipu are Incan knotted cord recording devices. This package implements the mathematics of knotted data structures: encoding numbers as knot sequences, building cord hierarchies, arithmetic on quipus, and error detection via parity knots.
Ported from the Python quipu-math package.
npm install quipu-math
import { encodeNumber, decodeKnots, Cord, CordTree, addQuipus } from "quipu-math";
// Encode a number as a knot sequence
const knots = encodeNumber(247);
// Decode back
const n = decodeKnots(knots); // 247
// Build a cord tree
const tree = new CordTree();
tree.addPendant(new Cord("red", encodeNumber(100)));
tree.addPendant(new Cord("blue", encodeNumber(47)));
// Quipu arithmetic
const result = addQuipus(tree, otherTree);
encodeNumber(n), decodeKnots(knots), checksum(knots)Cord class with addKnot, serialize(), deserialize(json), CordTree class with addPendant, traverse()weave(cord1, cord2), unweave(cord), isAssociative(a, b, c)addQuipus(t1, t2), subtractQuipus(t1, t2), multiplyQuipus(t1, t2)detectCorruption(original, copy) → CorruptionReportnpm test
MIT License
FAQs
Mathematics of Incan knotted cord (quipu) data structures for JavaScript/TypeScript
The npm package quipu-math receives a total of 12 weekly downloads. As such, quipu-math popularity was classified as not popular.
We found that quipu-math demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Company News
Socket’s first CISO brings deep experience securing high-growth SaaS companies as open source supply chain threats accelerate.

Company News
Replit is integrating Socket Firewall into its AI-powered development experience to help protect builders from malicious open source packages.

Security News
npm confirmed a tooling bug incorrectly marked several one-character packages as security holders and said it was working on a rollback.