mirror of
https://github.com/bitwarden/server.git
synced 2024-12-30 18:17:36 +01:00
24 lines
6.1 KiB
C#
24 lines
6.1 KiB
C#
|
using BenchmarkDotNet.Attributes;
|
|||
|
using Bit.Core.Utilities;
|
|||
|
|
|||
|
namespace Bit.MicroBenchmarks.Core;
|
|||
|
|
|||
|
[MemoryDiagnoser]
|
|||
|
public class EncryptedStringAttributeTests
|
|||
|
{
|
|||
|
private readonly EncryptedStringAttribute _encryptedStringAttribute;
|
|||
|
public EncryptedStringAttributeTests()
|
|||
|
{
|
|||
|
_encryptedStringAttribute = new EncryptedStringAttribute();
|
|||
|
}
|
|||
|
|
|||
|
public const string Short = @"2.QmFzZTY0UGFydA==|QmFzZTY0UGFydA==|QmFzZTY0UGFydA==";
|
|||
|
public const string Long = @"2.KllcSp3E124kblnMlCNQuQ==|G0jvyocNBOEzCyJ/f951Pz348MPi2RLzmsbfOAOtszi5L9WAkWe4L5T2gJukRMgDSvdE76MVUqREsgQZME52t8JFpVzsQU7Ee56szoJu\u002BAHHQkBNd5J2WirgprDRmIGiSdbvv2GoCszr1b2Ox/Pc\u002B9wjjzMjR6ZA3xhvy1UPyFdT5edQvIFVRSOEG7ivtV7RmGxiq7buP/g\u002BL/epeuiljkjU7KU8JbZRKaxhGLSiofEMlBtaTZtTGh3VKAHslUgPnRIRlHpjPDaT1Yw3la4YHbEOs4Y/XJ5sI4q5xXlK60gMgAlvlyH0mspezaBy367WBLu\u002BWC/4GqGBudhftSOED/aIS4PoCUvMdftwHunXjE2s5zDUwT66w30lvEvJbs7m/36fKAj9ujqOv9vEm1Ukjxhzk\u002BHHkLUcjrD57Zfn0P\u002BzK6wbneYBORObF70gUhcINv64GqgLFlEUecmKjK0ZgcmTXp8XuG2ZfplXAN1y8gySM3UAREhFj4oQtZq/QB64SlnOTAPkRjqy0khqWCmySqSSqKYCnzTfE7RUhR6FAgpWTo9qHZHkwNVk2EBWvMN0UctjmYIpoUBtqKPF2Oidhjnck\u002BqCa7jGIqGetERq9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eaic1UFC\u002BXZ1UcwbFZK43pc9iYyoxMboxi\u002Bq5ZX0nQXseiv8OsijrFmm5d/0R\u002BRpS
|
|||
|
|
|||
|
[Params(Short, Long)]
|
|||
|
public string EncryptedString { get; set; } = null!;
|
|||
|
|
|||
|
[Benchmark]
|
|||
|
public bool IsValid() => _encryptedStringAttribute.IsValid(EncryptedString);
|
|||
|
}
|