For excessively paranoid client authentication.
Updated Apr 5 2019:
because this is a gist from 2011 that people stumble into and maybe you should AES instead of 3DES in the year of our lord 2019.
some other notes:
| Latency Comparison Numbers (~2012) | |
| ---------------------------------- | |
| L1 cache reference 0.5 ns | |
| Branch mispredict 5 ns | |
| L2 cache reference 7 ns 14x L1 cache | |
| Mutex lock/unlock 25 ns | |
| Main memory reference 100 ns 20x L2 cache, 200x L1 cache | |
| Compress 1K bytes with Zippy 3,000 ns 3 us | |
| Send 1K bytes over 1 Gbps network 10,000 ns 10 us | |
| Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD |
| public class EnumMapper : IDisposable | |
| { | |
| readonly Dictionary<Type, Dictionary<string, object>> _stringsToEnums = | |
| new Dictionary<Type, Dictionary<string, object>>( ) ; | |
| readonly Dictionary<Type, Dictionary<int, string>> _enumNumbersToStrings = | |
| new Dictionary<Type, Dictionary<int, string>>( ) ; | |
| readonly ReaderWriterLockSlim _lock = new ReaderWriterLockSlim( ) ; |