burgerbibliothek / ark-management-tools
PHP library for minting / validating Archival Resource Keys (ARK) and managing Electronic Resource Citation (ERC) Records.
Package info
github.com/burgerbibliothek/ark-management-tools
pkg:composer/burgerbibliothek/ark-management-tools
v0.0.22
2026-08-06 07:48 UTC
Requires
- php: ^8.3
Requires (Dev)
- phpdocumentor/shim: ^3.9
- phpstan/phpstan: ^2.0
- phpunit/phpunit: ^11.2
- vimeo/psalm: ^6.13
README
PHP Library for minting / validating Archival Resource Keys (ARK) and managing Electronic Resource Citation (ERC) Records.
Examples
Generate new ARK
use Burgerbibliothek\ArkManagementTools\Ark echo ARK::generate('12345', '0123456789bcdfghjkmnpqrstvwxz', 7, 'q1');
Expected possible output:
12345/q15fk5zszx
Verify ARK with NOID Check digit algorithm
use Burgerbibliothek\ArkManagementTools\Ncda echo ARK::verify('12345/q15fk5zszx', '0123456789bcdfghjkmnpqrstvwxz');
Output:
true
Split ARK into components
use Burgerbibliothek\ArkManagementTools\Ark var_dump(Ark::splitIntoComponents('https://ark.example.tld/ark:/99999/a1b2c3d4e5f6g/suffix?info'));
Output
array(7) { ["resolverService"]=> string(24) "https://ark.example.tld/" ["naan"]=> string(5) "99999" ["baseName"]=> string(13) "a1b2c3d4e5f6g" ["baseCompactName"]=> string(23) "ark:99999/a1b2c3d4e5f6g" ["checkZone"]=> string(19) "99999/a1b2c3d4e5f6g" ["suffixes"]=> string(11) "suffix?info" ["inflection"]=> string(5) "?info" }
Create ERC record
$record = new Erc; $record->add('who', 'Burgerbibliothek Bern'); $record->add('what', 'Value 1'); $record->add('what', 'Value 2'); $record->add('when', '2026-08-06'); echo $record->record();
Output
erc:
who: Burgerbibliothek Bern
what: Value 2; Value 1
when: 2026-08-06