public enum HmacAlgorithms { HMAC_MD5 = 0, HMAC_SHA_1 = 1, HMAC_SHA_224 = 2, HMAC_SHA_256 = 3, HMAC_SHA_384 = 4, HMAC_SHA_512 = 5 }

public static class HmacAlgorithmsExtensions { public static string GetName(this HmacAlgorithms algorithm) { switch (algorithm) { case HmacAlgorithms.HMAC_MD5: return "HmacMD5"; case HmacAlgorithms.HMAC_SHA_1: return "HmacSHA1"; case HmacAlgorithms.HMAC_SHA_224: return "HmacSHA224"; case HmacAlgorithms.HMAC_SHA_256: return "HmacSHA256"; case HmacAlgorithms.HMAC_SHA_384: return "HmacSHA384"; case HmacAlgorithms.HMAC_SHA_512: return "HmacSHA512"; default: throw new ArgumentException("Invalid HmacAlgorithm"); } }

public static string ToString(this HmacAlgorithms algorithm)
{
    return algorithm.GetName();
}
public enum HmacAlgorithms HMAC_MD5HmacMD5 HMAC_SHA_1HmacSHA1 HMAC_SHA_224HmacSHA224 HMAC_SHA_256HmacSHA256 HMAC_SHA_384HmacSHA384 HMAC_SHA_512HmacSHA512; private final String na

原文地址: https://www.cveoy.top/t/topic/hJCp 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录