pjfanning commented on issue #702:
URL: 
https://github.com/apache/pekko-management/issues/702#issuecomment-4074345136

   https://github.com/akka/akka-management/issues/910 is a related issue. We 
can't copy the Akka solution because its license.
   But we can write our own solution.
   
   Claude suggested this to me:
   ```
   private def makeDNS1039Compatible(name: String): String = {
     val normalized =
       Normalizer.normalize(name, Normalizer.Form.NFKD).toLowerCase
         .replaceAll("[_.]", "-")
         .replaceAll("[^-a-z0-9]", "")
     val trimmed = trim(normalized, List('-'))
     if (trimmed.length <= 63) trimmed
     else {
       val hash = Integer.toHexString(name.hashCode).take(8) // 8 hex chars
       val prefix = trim(trimmed.take(63 - 9), List('-'))    // 63 - 1 dash - 8 
hash
       s"$prefix-$hash"
     }
   }
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to