860 |
return $d; |
return $d; |
861 |
} |
} |
862 |
|
|
863 |
=head2 base62 |
=head2 base_x |
864 |
|
|
865 |
Convert number to base62 (used for jsFind index filenames). |
Convert number to base x (used for jsFind index filenames). |
866 |
|
|
867 |
my $n = $tree->base62(50); |
my $n = $tree->base_x(50); |
868 |
|
|
869 |
=cut |
=cut |
870 |
|
|
871 |
sub base62 { |
sub base_x { |
872 |
my $self = shift; |
my $self = shift; |
873 |
|
|
874 |
my $value = shift; |
my $value = shift; |
878 |
my @digits = qw( |
my @digits = qw( |
879 |
0 1 2 3 4 5 6 7 8 9 |
0 1 2 3 4 5 6 7 8 9 |
880 |
a b c d e f g h i j k l m n o p q r s t u v w x y z |
a b c d e f g h i j k l m n o p q r s t u v w x y z |
|
A B C D E F G H I J K L M N O P Q R S T U V W X Y Z |
|
881 |
); |
); |
882 |
|
|
883 |
my $base = scalar(@digits); |
my $base = scalar(@digits); |
919 |
confess("path is undefined.") unless ($path); |
confess("path is undefined.") unless ($path); |
920 |
confess("file is undefined. Did you call \$t->root->to_jsfind(..) instead of \$t->to_jsfind(..) ?") unless (defined($file)); |
confess("file is undefined. Did you call \$t->root->to_jsfind(..) instead of \$t->to_jsfind(..) ?") unless (defined($file)); |
921 |
|
|
922 |
$file = $self->base62($file); |
$file = $self->base_x($file); |
923 |
|
|
924 |
my $nr_keys = 0; |
my $nr_keys = 0; |
925 |
|
|