@backblaze-labs/b2-sdk - v0.1.0
    Preparing search index...

    Class IncrementalSha1

    Incrementally computes SHA-1 hashes over streaming data. Uses Node.js crypto when available, falling back to WebCrypto.

    Index

    Constructors

    Accessors

    Methods

    Constructors

    Accessors

    • get bytesProcessed(): number

      Total number of bytes fed into the hash so far.

      Returns number

      The cumulative byte count across all update calls.

    Methods

    • Finalize the hash and return the hex-encoded SHA-1 digest.

      Returns Promise<string>

      The lowercase hex-encoded SHA-1 digest of all data fed so far.

    • Feed data into the hash. Async because it lazily initializes the crypto backend.

      Parameters

      • data: Uint8Array

        The bytes to include in the hash computation.

      Returns Promise<void>

      A promise that resolves once the data has been consumed.