• Calculates the hash of a given data buffer

    Parameters

    • hashAlgorithm: string

      Name of the hash algorithm to use, such as "sha512"

    • encodingType:
          | "base64"
          | "base64url"
          | "binary"
          | "hex"

      String encoding to use for returning the binary hash value that is calculated

    • buffer: Buffer

      Raw data to be fed into the hash algorithm

    Returns string

    String encoded value of the digest (https://csrc.nist.gov/glossary/term/hash_digest)