Skip to content

Commit

Permalink
Merge branch 'nmshdb-69-backbone-specific-addresses' of github.com:nm…
Browse files Browse the repository at this point in the history
…shd/backbone into nmshdb-69-backbone-specific-addresses
  • Loading branch information
Dannyps committed May 8, 2024
2 parents f725cc8 + 82e5c96 commit 8a2ff57
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ public partial record IdentityAddress : StronglyTypedId
{
public const int MAX_LENGTH = 80;
private const int CHECKSUM_LENGTH = 2;
private const string CHECKSUM_LENGTH_S = "2";

private IdentityAddress(string stringValue) : base(stringValue)
{
Expand Down Expand Up @@ -64,7 +65,6 @@ public static bool IsValid(string? stringValue)
var checksumIsValid = givenChecksum.Value == expectedChecksum;

return checksumIsValid;

}

public static IdentityAddress Create(byte[] publicKey, string instanceUrl)
Expand Down Expand Up @@ -124,7 +124,7 @@ public static implicit operator IdentityAddress(string stringValue)
return ParseUnsafe(stringValue);
}

[GeneratedRegex(@"^(?<addressWithoutChecksum>did\:e\:(?<instanceUrl>(?:[a-z0-9]+\.)+[a-z]{2,})\:dids\:(?<identitySpecificPart>[0-9abcdef]{20}))(?<checksum>[0-9abcdef]{2})$")]
[GeneratedRegex($@"^(?<addressWithoutChecksum>did:e:(?<instanceUrl>(?:[a-z0-9]+\.)+[a-z]{{2,}}):dids:(?<identitySpecificPart>[0-9abcdef]{{20}}))(?<checksum>[0-9abcdef]{{{CHECKSUM_LENGTH_S}}})$")]
private static partial Regex IdentityAddressValidatorRegex();

#endregion
Expand Down

0 comments on commit 8a2ff57

Please sign in to comment.