![]() My $md5_uuid = create_uuid(UUID_MD5, $str) While the 1.0x versions will continue to export the old, "legacy" interface on default, the future standard interface is available using the :std tag on import from version 1.02 on: use UUID::Tiny ':std' And that it is more polite to export symbols only on demand. ATTENTION! NEW STANDARD INTERFACEĪfter some debate I'm convinced that it is more Perlish (and far easier to write) to use all-lowercase function names - without exceptions. If you are using this module on a Perl prior to 5.10 and you don't have Digest::SHA1 installed, you can use Digest::SHA::PurePerl instead. These are the modules UUID::Tiny depends on: Carpĭigest::SHA Perl 5.10 core (or Digest::SHA1, or Digest::SHA::PurePerl) This module should run from Perl 5.8 up and uses mostly standard (5.8 core) modules for its job. There is a test file for threads, but it is de-activated. Schwern (thanks!), Digest::MD5 and Digest::SHA seem so have trouble with threads. Even though I've incorporated some changes proposed by Michael G. This module is currently not "thread safe". This module is "fork safe", especially for random UUIDs (it works around Perl's rand() problem when forking processes). ![]() If you need raw performance for UUID creation, or the real MAC address in version 1 UUIDs, or an OO interface, and if you can afford module compilation and installation on the target system, then better look at other CPAN UUID modules like Data::UUID. UUID::Tiny deliberately uses a minimal functional interface for UUID creation (and conversion/testing), because in this case OO looks like overkill to me and makes the creation and use of UUIDs unnecessarily complicated. Conversion, test and time functions equally accept UUIDs and UUID strings, so don't bother to convert UUIDs for them!Ĭontinuing with 1.0x versions all constants and public functions are exported by default, but this will change in the future (see below). No fancy OO interface, no plethora of different UUID representation formats and transformations - just string and binary. This module provides the creation of version 1 time based UUIDs (using random multicast MAC addresses), version 3 MD5 based UUIDs, version 4 random UUIDs, and version 5 SHA-1 based UUIDs.ĪTTENTION! UUID::Tiny uses Perl's rand() to create the basic random numbers, so the created v4 UUIDs are not cryptographically strong! UUID::Tiny is a lightweight, low dependency Pure Perl module for UUID creation and testing. My $uuid_clk_seq = clk_seq_of_uuid($v1_mc_UUID) DESCRIPTION My $uuid_time = time_of_uuid($v1_mc_UUID) My $v3_md5_UUID_string = uuid_to_string($v3_md5_UUID) My $v1_mc_UUID_string = create_uuid_as_string(UUID_V1) My $v5_with_NS_UUID = create_uuid(UUID_SHA1, UUID_NS_DNS, '') My $v5_sha1_UUID = create_uuid(UUID_V5, $str) My $v4_rand_UUID_2 = create_uuid(UUID_RANDOM) My $v3_md5_UUID = create_uuid(UUID_V3, $str) My $v1_mc_UUID_3 = create_uuid(UUID_TIME) UUID::Tiny - Pure Perl UUID Support With Functional Interface VERSIONĬreate version 1, 3, 4 and 5 UUIDs: use UUID::Tiny ':std'
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |