diff options
author | Eric Wong <e@80x24.org> | 2023-01-29 10:30:41 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2023-01-30 06:42:31 +0000 |
commit | e6aa13bccb7ea5d5b3246b3a944621515905e360 (patch) | |
tree | 822309b8cc2ac85ba50acd33deebb03891b0844b /lib/PublicInbox/MID.pm | |
parent | 9eb8baf199cd148b7ebf8e6e130fb832f4e1ef00 (diff) | |
download | public-inbox-e6aa13bccb7ea5d5b3246b3a944621515905e360.tar.gz |
On my x86-64 machine, OpenSSL SHA-256 is nearly twice as fast as the Digest::SHA implementation from Perl, most likely due to an optimized assembly implementation. SHA-1 is a few percent faster, too.
Diffstat (limited to 'lib/PublicInbox/MID.pm')
-rw-r--r-- | lib/PublicInbox/MID.pm | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/PublicInbox/MID.pm b/lib/PublicInbox/MID.pm index 35b517e0..4819cc25 100644 --- a/lib/PublicInbox/MID.pm +++ b/lib/PublicInbox/MID.pm @@ -1,15 +1,15 @@ -# Copyright (C) 2015-2021 all contributors <meta@public-inbox.org> +# Copyright (C) all contributors <meta@public-inbox.org> # License: AGPL-3.0+ <https://www.gnu.org/licenses/agpl-3.0.txt> # # Various Message-ID-related functions. package PublicInbox::MID; use strict; -use warnings; -use base qw/Exporter/; +use v5.10.1; # TODO: check unicode_strings compat for v5.12 +use parent qw(Exporter); our @EXPORT_OK = qw(mid_clean id_compress mid2path mid_escape MID_ESC mids references mids_for_index mids_in $MID_EXTRACT); use URI::Escape qw(uri_escape_utf8); -use Digest::SHA qw/sha1_hex/; +use PublicInbox::SHA qw(sha1_hex); require PublicInbox::Address; use constant { ID_MAX => 40, # SHA-1 hex length for HTML id anchors |