Crypto Vue
    Preparing search index...

    Interface UseHashReturn

    Reactive state and methods returned by useHash.

    const state: UseHashReturn = useHash();
    await state.hash("sha256", "data");
    console.log(state.digest.value);
    interface UseHashReturn {
        digest: DeepReadonly<Ref<string | null>>;
        algorithm: DeepReadonly<Ref<HashAlgorithm | null>>;
        isHashing: DeepReadonly<Ref<boolean>>;
        error: DeepReadonly<Ref<Error | null>>;
        hash: (
            algo:
                | "sha256"
                | "sha384"
                | "sha512"
                | "sha3-256"
                | "sha3-512"
                | "blake2b"
                | "blake3",
            data: string | Uint8Array<ArrayBufferLike>,
        ) => Promise<string>;
        clear: () => void;
    }
    Index
    digest: DeepReadonly<Ref<string | null>>

    The most recent hash digest (hex-encoded).

    algorithm: DeepReadonly<Ref<HashAlgorithm | null>>

    The algorithm used for the last hash.

    isHashing: DeepReadonly<Ref<boolean>>

    Whether a hash operation is in progress.

    error: DeepReadonly<Ref<Error | null>>

    Error from the last hash attempt, if any.

    hash: (
        algo:
            | "sha256"
            | "sha384"
            | "sha512"
            | "sha3-256"
            | "sha3-512"
            | "blake2b"
            | "blake3",
        data: string | Uint8Array<ArrayBufferLike>,
    ) => Promise<string>

    Hash data with the specified algorithm.

    clear: () => void

    Clear all reactive state.