Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
forge001
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Gerhard Gonter
forge001
Commits
8c29f939
Commit
8c29f939
authored
11 years ago
by
Gerhard Gonter
Browse files
Options
Downloads
Patches
Plain Diff
added P4C1L which is more appropriate for hex codes, e.g. md5 or uid
parent
35577cc2
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
textarchive/lib/TA/Hasher.pm
+24
-1
24 additions, 1 deletion
textarchive/lib/TA/Hasher.pm
with
24 additions
and
1 deletion
textarchive/lib/TA/Hasher.pm
+
24
−
1
View file @
8c29f939
...
...
@@ -9,7 +9,7 @@ package TA::Hasher;
use
Data::
Dumper
;
$
Data::Dumper::
Indent
=
1
;
my
%known_algorithms
=
map
{
$_
=>
1
}
qw(NULL S3C1L S3C2L P3C3L P3C2L P3C1L)
;
my
%known_algorithms
=
map
{
$_
=>
1
}
qw(NULL S3C1L S3C2L P3C3L P3C2L P3C1L
P4C1L
)
;
sub
new
{
...
...
@@ -51,6 +51,10 @@ sub new
{
$obj
->
{'
mkpo
'}
=
\
&
TA::Hasher::P3C1L::
mkpo
;
}
elsif
(
$algorithm
eq
'
P4C1L
')
{
$obj
->
{'
mkpo
'}
=
\
&
TA::Hasher::P4C1L::
mkpo
;
}
else
{
$obj
->
{'
mkpo
'}
=
\
&
TA::Hasher::NULL::
mkpo
;
...
...
@@ -217,6 +221,23 @@ sub mkpo
return
{
'
L
'
=>
\
@L
};
}
package
TA::Hasher::
P4C1L
;
sub
mkpo
{
my
$S
=
shift
;
return
undef
unless
(
defined
(
$S
));
my
@L
;
if
(
$S
=~
m#^(.{1,4})#
)
{
@L
=
(
$
1
);
}
else
{
@L
=
(
$S
);
}
return
{
'
L
'
=>
\
@L
};
}
1
;
__END__
...
...
@@ -227,5 +248,7 @@ __END__
=item check_path ($mkpo)
=item method to register hasher algorithm
=back
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment