digest() {
    let digest = [];
    let totalBits = this.total_ * 8;

    // Add pad 0x80 0x00*.
    if (this.inbuf_ < 56) {
      this.update(this.pad_, 56 - this.inbuf_);
    } else {
      this.update(this.pad_, BLOCK_SIZE - (this.inbuf_ - 56));
    }

    // Add # bits.
    for (let i = BLOCK_SIZE - 1; i >= 56; i--) {
      this.buf_[i] = totalBits & 255;
      totalBits /= 256;  // Don't use bit-shifting here!
    }

    this.compress_(this.buf_);

    let n = 0;
    for (let i = 0; i < 5; i++) {
      for (let j = 24; j >= 0; j -= 8) {
        digest[n] = (this.chain_[i] >> j) & 255;
        ++n;
      }
    }

    return digest;
  }
/**
   * @return {!Array<number>} The finalized hash computed
   *     from the internal accumulator.
   */
@return {!Array} The finalized hash computed
from the internal accumulator.
@return { !Array } The finalized hash computed from the internal accumulator .
digest() {
    let digest = [];
    let totalBits = this.total_ * 8;
    if (this.inbuf_ < 56) {
      this.update(this.pad_, 56 - this.inbuf_);
    } else {
      this.update(this.pad_, BLOCK_SIZE - (this.inbuf_ - 56));
    }
    for (let i = BLOCK_SIZE - 1; i >= 56; i--) {
      this.buf_[i] = totalBits & 255;
      totalBits /= 256;  
    }
    this.compress_(this.buf_);
    let n = 0;
    for (let i = 0; i < 5; i++) {
      for (let j = 24; j >= 0; j -= 8) {
        digest[n] = (this.chain_[i] >> j) & 255;
        ++n;
      }
    }
    return digest;
  }
digest ( ) { let digest = [ ] ; let totalBits = this . total_ * 8 ; if ( this . inbuf_ < 56 ) { this . update ( this . pad_ , 56 - this . inbuf_ ) ; } else { this . update ( this . pad_ , BLOCK_SIZE - ( this . inbuf_ - 56 ) ) ; } for ( let i = BLOCK_SIZE - 1 ; i >= 56 ; i -- ) { this . buf_ [ i ] = totalBits & 255 ; totalBits /= 256 ; } this . compress_ ( this . buf_ ) ; let n = 0 ; for ( let i = 0 ; i < 5 ; i ++ ) { for ( let j = 24 ; j >= 0 ; j -= 8 ) { digest [ n ] = ( this . chain_ [ i ] >> j ) & 255 ; ++ n ; } } return digest ; }
@return {!Array<number>} The finalized hash computed
     from the internal accumulator.
@return { !Array<number > } The finalized hash computed from the internal accumulator .
// Add pad 0x80 0x00*. // Add # bits. // Don't use bit-shifting here!