Table of Contents

Method Compute

Namespace
DocWright.Cryptography
Assembly
DocWright.Cryptography.dll

Compute(string, OfficeHashAlgorithmKind, byte[], int, ResourceLimits?)

Computes a protection hash.

public static byte[] Compute(string password, OfficeHashAlgorithmKind algorithm, byte[] salt, int spinCount, ResourceLimits? limits = null)

Parameters

password string

The password.

algorithm OfficeHashAlgorithmKind

The hash algorithm.

salt byte[]

The salt bytes.

spinCount int

The iteration count.

limits ResourceLimits

The resource caps, or null for the defaults.

Returns

byte[]

The hash bytes.

Exceptions

ArgumentNullException

An argument is null.

ArgumentOutOfRangeException

spinCount is negative.

ResourceLimitExceededException

The spin count exceeds the cap.