Coconstructor
Bun

constructor

SHA1.constructor

constructor (): SHA1;

Referenced types

class SHA1

This is not the default because it's not cryptographically secure and it's slower than SHA512

Consider using the ugly-named SHA512_256 instead

  • readonly static byteLength: 20

    The number of bytes the hash will produce

  • encoding: DigestEncoding
    ): string;

    Finalize the hash

    @param encoding

    DigestEncoding to return the hash in. If none is provided, it will return a Uint8Array.

    hashInto?: TypedArray<ArrayBufferLike>
    ): TypedArray;

    Finalize the hash

    @param hashInto

    TypedArray to write the hash into. Faster than creating a new one each time

  • ): SHA1;

    Update the hash with data

  • static hash(
    hashInto?: TypedArray<ArrayBufferLike>
    ): TypedArray;

    Run the hash over the given data

    @param input

    string, Uint8Array, or ArrayBuffer to hash. Uint8Array or ArrayBuffer is faster.

    @param hashInto

    TypedArray to write the hash into. Faster than creating a new one each time

    static hash(
    encoding: DigestEncoding
    ): string;

    Run the hash over the given data

    @param input

    string, Uint8Array, or ArrayBuffer to hash. Uint8Array or ArrayBuffer is faster.

    @param encoding

    DigestEncoding to return the hash in