Search by

b4moss / shardian

kohki

Create sharded path strings from filenames

v0.6.0 2026-09-25 03:28 UTC

This package is not auto-updated.

Last update: 2026-09-26 02:12:34 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