(input string)
| 69 | } |
| 70 | |
| 71 | func truncateAndHashIfExceed(input string) string { |
| 72 | if len(input) <= LabelMaxLength { |
| 73 | return input |
| 74 | } |
| 75 | prefix := input[:LabelMaxLength-MD5Length] |
| 76 | suffix := input[LabelMaxLength-MD5Length:] |
| 77 | hash := md5.Sum([]byte(suffix)) |
| 78 | return prefix + hex.EncodeToString(hash[:]) |
| 79 | } |
no outgoing calls