INNER CODE UNIT · JavaScript

__hash_dotnetfx_managed__

gnh1201/welsonjs · app.js:558

function __hash_dotnetfx_managed__(str, algorithm) {
    algorithm = String(algorithm || "").toLowerCase();
    
    var allowed_algorithm = INTEGRITY_ALLOWED_ALGORITHMS;
    var encoding = "utf-8";

    if (!(algorithm in allowed_algorithm && allowed_algorithm[algorithm])) {
        throw new Error("Unsupported hash algorithm: " + algorithm);
    }

    var resolveProgId = function(alias) {
        var map = {
            "sha1": "System.Security.Cryptography.SHA1Managed",
            "sha256": "System.Security.Cryptography.SHA256Managed",
            "sha384": "System.Security.Cryptography.SHA384Managed",
            "sha512": "System.Security.Cryptography.SHA512Managed",
            "utf-8": "System.Text.UTF8Encoding"
        };

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…