NAME
Unique - A source of deterministic pseudorandom strings [DPS]. Objects of this class will generate a series of DPS of a set length for a set 2 char 'salt' [similar to UNIX crypt's salt] and resettable string that is assumed to be a date string [although this is not enforced].
Note that if the date string is changed, the object resets itself and begins to generate a new series for the new date string.
VERSION
Version 1.02
SYNOPSIS
use Unique;
my $dayrefs = Unique->new({characterCount => 11, salt => 'AT',});
my $string = $dayrefs->getStringByIndex(9999);
...
METHODS
new
Class constructor new
Requires a hash ref containing a salt, string length and date
reset
Reset the day structure for date.
getStringByIndex
Return the unique string in the [index] sequence for the given date or today is date is not supplied. This seldom used class method is optimized for memory not speed.
getIndexByString
Return [index] for the unique string in the sequence for the given dat. This seldom used class method is optimized for memory not speed.
getNextString
The primary method of this class. In scalar context returns the next entry in the daily queue of pseudorandom strings, in list context returns the next entry and the day of year as a 3 digit string ie '012' == January 13th.
_initializeDay
Private class method; sets up the queue for date $datestring
_newUniqueString
Private class method; returns the next unique string in date: $datstring-s Queue
_randCharString
Private class method; returns a candidate string
ident Class method ident returns a string that uniquely identifies the object supplied
AUTHOR
Christian Werner Sr, << <saltbreez@cpan.org> >>
BUGS
Please report any bugs or feature requests to bug-unique at rt.cpan.org
, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Unique. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.
SUPPORT
You can find documentation for this module with the perldoc command.
perldoc Unique
You can also look for information at:
RT: CPAN's request tracker (report bugs here)
AnnoCPAN: Annotated CPAN documentation
CPAN Ratings
Search CPAN
COPYRIGHT & LICENSE
Copyright 2007,2008 Wells Fargo, all rights reserved. Copyright 2011 Christian Werner Sr.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.