PHPackages                             anuar/digitalroot - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. anuar/digitalroot

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

anuar/digitalroot
=================

Library for getting digital root from numbers and letters.

v1.0.0(5y ago)210MITPHPCI failing

Since May 29Pushed 5y ago1 watchersCompare

[ Source](https://github.com/alfetahe/digitalroot)[ Packagist](https://packagist.org/packages/anuar/digitalroot)[ RSS](/packages/anuar-digitalroot/feed)WikiDiscussions master Synced 6d ago

READMEChangelogDependencies (1)Versions (3)Used By (0)

digitalRoot
===========

[](#digitalroot)

Library for getting digital root from numbers and letters. You may also give letters numeric value for the calculation by passing an array of letters and their numeric values as a second parameter to the exposed functions. All examples and methods are shown below.

The digital root of a positive integer is found by summing the digits of the integer. If the resulting value is a single digit then that digit is the digital root. If the resulting value contains two or more digits, those digits are summed and the process is repeated. This is continued as long as necessary to obtain a single digit.

I am going to add additional functionality to this library in the future. Open to any new ideas.

Install
-------

[](#install)

Via Composer

```
$ composer require "anuar/digitalroot"
```

Usage examples
--------------

[](#usage-examples)

```
use \digitalRootSrc\digitalRootBuilder;

// Returns the digital root(single digit).
// Output: [
//            "client_input" => "23081996",
//            "digital_root" => 2
//         ]
digitalRootBuilder::getDigitalRoot("23081996");

// Returns the digital root complete calculation.
// Output: [
//            "client_input" => "299493218",
//            "digital_root" => 2,
//            "full_calculation" => [2,9,11,1,1,2,9,11,1,1,2,4,6,9,15,1,5,6,3,9,2,11,1,1,2,1,3,8,11,1,1,2]
digitalRootBuilder::getDigitalRootCompleteCalculation("299493218");

// Pass array and returns array of digital roots.
// Output: [
//           "23081996' => 2,
//           "43434336" => 3
//         ]
digitalRootBuilder::getdigitalRootBulk(["23081996","43434336"]);

// You can also give letters numeric value and get their digital root.
// Then you need to pass second parameter which gives each letter numeric value.
// Output: [
//            'client_input' => "abc12",
//            'digital_root' => 9
//         ]
digitalRootBuilder::getDigitalRoot("abc12", ["A" => 1, "B" => 2, "C" => 3]);
```

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity57

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

2179d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/b2cae2450394b32c2f17381ee002b2dc95c97d108e3563a7d39963dc667d023c?d=identicon)[alfetahe](/maintainers/alfetahe)

---

Top Contributors

[![alfetahe](https://avatars.githubusercontent.com/u/34630876?v=4)](https://github.com/alfetahe "alfetahe (42 commits)")

---

Tags

vortexnumerologydigital root

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/anuar-digitalroot/health.svg)

```
[![Health](https://phpackages.com/badges/anuar-digitalroot/health.svg)](https://phpackages.com/packages/anuar-digitalroot)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
