@technobuddha/library
Version: 
A large library of useful functions
39 lines (38 loc) • 1.09 kB
TypeScript
import { ShaBase } from './sha-base.ts';
/**
 * Secure Hash Algorithm, SHA-1
 * @example
 * ```typescript
 * const sha1 = new Sha1();
 * sha1.update('hello world', 'utf8');
 * sha1.digest('hex');
 * // '2aae6c35c94fcfb415dbe95f408b9ce91ee846ed'
 * ```
 * ```typescript
 * const sha1 = new Sha1();
 * sha1.update(new Uint8Array([0x68, 0x65, 0x6c, 0x6c, 0x6f, 0x20, 0x77, 0x6f, 0x72, 0x6c, 0x64]));
 * sha1.digest('hex');
 * // '2aae6c35c94fcfb415dbe95f408b9ce91ee846ed'
 * ```
 * @group Binary
 * @category Hash
 */
export declare class Sha1 extends ShaBase {
    private a;
    private b;
    private c;
    private d;
    private e;
    private readonly w;
    /**
     * Creates a new SHA-1 hash instance and initializes its internal state.
     *
     * @remarks
     * The internal state variables are set to the initial SHA-1 constants as specified
     * in FIPS PUB 180-1. Use {@link update} to process data and {@link digest} to retrieve the
     * final hash value.
     */
    constructor();
    protected updateCounters(buffer: Uint8Array): void;
    protected hash(): Uint8Array;
}