Interface nsICryptoHashType

nsICryptoHash This interface provides crytographic hashing algorithms.

Hierarchy

Methods

  • Increases the reference count for this interface. The associated instance will not be deleted unless the reference count is returned to zero.

    Returns

    The resulting reference count.

    Returns number

  • Parameters

    • aIID: object
    • Optional aInstancePtr: object

    Returns any

  • A run time mechanism for interface discovery.

    Returns

    NS_OK if the interface is supported by the associated instance, NS_NOINTERFACE if it is not.

    aInstancePtr must not be null.

    Parameters

    • aIID: object

      [in] A requested interface IID

    • aInstancePtr: object

      [out] A pointer to an interface pointer to receive the result.

    Returns void

  • Decreases the reference count for this interface. Generally, if the reference count returns to zero, the associated instance is deleted.

    Returns

    The resulting reference count.

    Returns number

  • Completes this hash object and produces the actual hash data.

    Returns

    a hash of the data that was read by this object. This can be either binary data or base 64 encoded.

    Throws

    NS_ERROR_NOT_INITIALIZED If |init| has not been called.

    NOTE: This method may be called any time after |init| is called. This call resets the object to its pre-init state.

    Parameters

    • aASCII: boolean

      If true then the returned value is a base64 encoded string. If false, then the returned value is binary data.

    Returns string

  • String value: "sha512"

    Initialize the hashing object. This method may be called multiple times with different algorithm types.

    Throws

    NS_ERROR_INVALID_ARG if an unsupported algorithm type is passed.

    NOTE: This method or initWithString must be called before any other method on this interface is called.

    Parameters

    • aAlgorithm: number

      the algorithm type to be used. This value must be one of the above valid algorithm types.

    Returns void

  • Initialize the hashing object. This method may be called multiple times with different algorithm types.

    Throws

    NS_ERROR_INVALID_ARG if an unsupported algorithm type is passed.

    NOTE: This method or init must be called before any other method on this interface is called.

    Parameters

    • aAlgorithm: string

      the algorithm type to be used.

    Returns void

  • Throws

    NS_ERROR_NOT_INITIALIZED If |init| has not been called.

    Parameters

    • aData: number

      a buffer to calculate the hash over

    • aLen: number

      the length of the buffer |aData|

    Returns void

  • Calculates and updates a new hash based on a given data stream.

    Throws

    NS_ERROR_NOT_INITIALIZED If |init| has not been called.

    Throws

    NS_ERROR_NOT_AVAILABLE If the requested amount of data to be calculated into the hash is not available.

    Parameters

    • aStream: nsIInputStream

      an input stream to read from.

    • aLen: number

      How much to read from the given |aStream|. Passing UINT32_MAX indicates that all data available will be used to update the hash.

    Returns void

Generated using TypeDoc