about summary refs log tree commit homepage
path: root/lib
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2020-09-15 19:51:36 +0000
committerEric Wong <e@80x24.org>2020-09-16 04:06:10 +0000
commit9cdeab04ebd95c7f778ba5f258399377b180f2cc (patch)
tree1606f2565dc877cd9153e87b64ae42e8442cb942 /lib
parent946fb6c1f90cbb7bc71a52b049e20f0872bdc4f0 (diff)
downloadpublic-inbox-9cdeab04ebd95c7f778ba5f258399377b180f2cc.tar.gz
It's only used for HTML anchors which we will need indefinitely.
Diffstat (limited to 'lib')
-rw-r--r--lib/PublicInbox/MID.pm4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/PublicInbox/MID.pm b/lib/PublicInbox/MID.pm
index e9a3b0c0..369bb034 100644
--- a/lib/PublicInbox/MID.pm
+++ b/lib/PublicInbox/MID.pm
@@ -12,7 +12,7 @@ use URI::Escape qw(uri_escape_utf8);
 use Digest::SHA qw/sha1_hex/;
 require PublicInbox::Address;
 use constant {
-        MID_MAX => 40, # SHA-1 hex length # TODO: get rid of this
+        ID_MAX => 40, # SHA-1 hex length for HTML id anchors
         MAX_MID_SIZE => 244, # max term size (Xapian limitation) - length('Q')
 };
 
@@ -32,7 +32,7 @@ sub mid_clean {
 sub id_compress {
         my ($id, $force) = @_;
 
-        if ($force || $id =~ /[^a-zA-Z0-9_\-]/ || length($id) > MID_MAX) {
+        if ($force || $id =~ /[^a-zA-Z0-9_\-]/ || length($id) > ID_MAX) {
                 utf8::encode($id);
                 return sha1_hex($id);
         }