Types::ULID - ULID type constraints
use Types::ULID qw(ULID BinaryULID); # coercion from undef will generate new ulid has 'id' => ( is => 'ro', isa => ULID, coerce => 1, default => sub { undef }, );
Types::ULID is Type::Tiny type for Data::ULID. See https://github.com/ulid/spec for ulid specification.
Type for text (base32-encoded) ulid. Can be coerced from undef - generates a new ulid.
undef
Type for binary ulid. Can be coerced from undef - generates a new ulid.
TODO: this does not currently check whether string contains multibyte characters.
Coercions provided by this module will use Data::ULID::XS to generate new ULIDs if it is available.
Data::ULID
Data::ULID::XS
Type::Tiny
Bartosz Jarzyna <bbrtj.pro@gmail.com>
Copyright (C) 2022 by Bartosz Jarzyna
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install Types::ULID, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Types::ULID
CPAN shell
perl -MCPAN -e shell install Types::ULID
For more information on module installation, please visit the detailed CPAN module installation guide.