PHPackages                             awheel/md52url - 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. awheel/md52url

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

awheel/md52url
==============

Use md5 mark file full path.

0.0.1(5y ago)0171proprietaryPHPPHP &gt;=5.3.0

Since Dec 10Pushed 5y ago1 watchersCompare

[ Source](https://github.com/awheel/md52url)[ Packagist](https://packagist.org/packages/awheel/md52url)[ RSS](/packages/awheel-md52url/feed)WikiDiscussions master Synced 1w ago

READMEChangelog (1)DependenciesVersions (2)Used By (1)

MD52URL
=======

[](#md52url)

通过使用文件的 md5 来还原文件的路径, 记录时仅仅记录 md5, 相对会方便很多.

因为需要上传的不仅仅是图片, 还有其它不确定的格式, 所以会在 md5 的后面额外添加 `3` 位, 如 `001` 来记录文件的格式.

`001` 对应一个 `table` 下的索引值, 可以还原到文件的类型和后缀.

如 `1aac0bdb5aeac0bdaa420c99e4d38725001`, 还原得到的路径是: `1a/ac/0b/1aac0bdb5aeac0bdaa420c99e4d38725001.jpg`

其中 `001` 对应 jpg.

安装方法:
=====

[](#安装方法)

```
composer require awheel/md52url;

```

使用方式:
=====

[](#使用方式)

```

use awheel\md52url;

$md2url = new md52url([
    'http://img1.example.com',
    'http://img2.example.com',
    'http://img3.example.com',
    'http://img4.example.com',
]);

$md5 = $md2url->md5(__DIR__.'/test.png');
echo $md5.PHP_EOL;

$path = $md2url->path($md5);
echo $path.PHP_EOL;

$url = $md2url->url($md5);
echo $url.PHP_EOL;

```

###  Health Score

19

—

LowBetter than 10% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity38

Early-stage or recently created project

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

1986d ago

### Community

Maintainers

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

---

Tags

filemd5path

### Embed Badge

![Health badge](/badges/awheel-md52url/health.svg)

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

###  Alternatives

[devaly/wordpress-routes

Manage rewrites and routes in WordPress with this dead-simple plugin

101.3k](/packages/devaly-wordpress-routes)

PHPackages © 2026

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