@string-data-structure/fibonacci-string

1.0.0 • Public • Published

🐚 @string-data-structure/fibonacci-string

Fibonacci string for JavaScript. See docs.

⚠️ Depending on your environment, the code may require regeneratorRuntime to be defined, for instance by importing regenerator-runtime/runtime.

import {makeIndex, query} from '@string-data-structure/fibonacci-string';

const F = makeIndex({iadd: (x, y) => x+y, zero: () => 1, one: () => 2}, 10);

query(F, 0); // 0
query(F, 1); // 1
query(F, 2); // 0
query(F, 3); // 0
query(F, 4); // 1
query(F, 5); // 0
query(F, 6); // 1
query(F, 7); // 0
query(F, 8); // 0
query(F, 9); // 1
query(F, 10); // 0

const Fn = makeIndex({iadd: (x, y) => x+y, zero: () => 1n, one: () => 2n}, 10n**100n);
query(Fn, 4802349082340928340983n); // 1n
query(Fn, 123456748023490823409283409834802349082340928340983n); // 0n

License Version Tests Dependencies Dev dependencies GitHub issues Downloads

Code issues Code maintainability Code coverage (cov) Code technical debt Documentation Package size

Package Sidebar

Install

npm i @string-data-structure/fibonacci-string

Weekly Downloads

1

Version

1.0.0

License

AGPL-3.0

Unpacked Size

480 kB

Total Files

14

Last publish

Collaborators

  • raskat
  • aureooms