• Create a hash object.

    Parameters

    • hash: Hashs

      Indicates the hash algorithm name. Note: MD5 and SHA1 are insecure hash algorithms.

    Returns Hash

    Example


    import * as crypto from 'crypto';
    import * as buffer from 'buffer';

    let hash = crypto.createHash(crypto.Hashs.SHA512);

    console.log(hash.sum(buffer.from("11111111111111")).toString(buffer.Encoding.Base64));