public void CryptoGuid_BasicUsage() { //// Application Set Defaults CryptoGuid.SetDefaultAlgorithm(new DotNetGuidAlgorithm()); // Set Once in the Application ... throw exception on 2nd time. //// Instance Based w/ No Factor Defaults string guid = CryptoGuid.NewGuid(); bool isValid = CryptoGuid.Verify(guid); }
public void CryptoGuid_FullTests() { string guid = null; CryptoGuid.EnforceSingleSetDefaultAlgorithm = false; CryptoGuid.SetDefaultAlgorithm(new Sha256GuidAlgorithm()); guid = CryptoGuid.NewGuid(); Assert.IsTrue(CryptoGuid.Verify(guid)); CryptoGuid.SetDefaultAlgorithm(new Md5GuidAlgorithm()); guid = CryptoGuid.NewGuid(); Assert.IsTrue(CryptoGuid.Verify(guid)); CryptoGuid.SetDefaultAlgorithm(new DotNetGuidAlgorithm()); guid = CryptoGuid.NewGuid(); Assert.IsTrue(CryptoGuid.Verify(guid)); }
public void GenerateClientSecret() => ClientSecret = CryptoGuid.GetExtendedCryptoString();