Search by

b4moss / shardian

kohki

Create sharded path strings from filenames

v1.0.0 2026-09-29 07:55 UTC

This package is auto-updated.

Last update: 2026-10-08 10:36:51 UTC


README

Create sharded path strings from filenames.

Source of truth: b4moss/shardian (packages/php)
Packagist mirror: b4moss/shardian-php (CD-updated; do not edit by hand)

use function B4moss\Shardian\shardian;
use function B4moss\Shardian\shardianSplit;

$path = shardian('abc1234.jpg');
// => '/a/b/c/1/abc1234.jpg'

$path = shardian('abc1234.jpg', ['stripHeadSlash' => true]);
// => 'a/b/c/1/abc1234.jpg'

$split = shardianSplit('abc1234.jpg');
// $split->pathOnly => '/a/b/c/1/'
composer require b4moss/shardian

Full contract and tests live in the monorepo: docs/specs/path-api.md, docs/tests/shardian-php.md.

License

MIT