···44const storage =
55 typeof browser !== "undefined" ? browser.storage.local : chrome.storage.local
6677-// Regular expression to validate the DID format
88-// Make sure that we don't DoS the regex if someone supplies too large of a DID.
77+// Make sure that we don't DoS the regex if someone supplies too large of a DID
88+// 1024 was arbitratily chosen to limit performance impact, I couldn't find any specicied limits on DID length
99const MAX_DID_LENGTH = 1024
1010+1111+// Regular expression to validate the DID format
1012const didRegex =
1113 /^did:plc:([a-zA-Z0-9._-]+(:[a-zA-Z0-9._-]+)*|((%[0-9A-Fa-f]{2})|[a-zA-Z0-9._-])+(:((%[0-9A-Fa-f]{2})|[a-zA-Z0-9._-])+)*$)/
1214