* Asserts that a number is a valid length for a digest, which must be an * integer that fits in a Rust `Vec `, or be undefined.
(value?: number)
| 300 | * integer that fits in a Rust `Vec<u8>`, or be undefined. |
| 301 | */ |
| 302 | function assertValidDigestLength(value?: number) { |
| 303 | if ( |
| 304 | value !== undefined && |
| 305 | (value < 0 || value > MAX_DIGEST_LENGTH || |
| 306 | !Number.isInteger(value)) |
| 307 | ) { |
| 308 | throw new RangeError( |
| 309 | `length must be an integer between 0 and ${MAX_DIGEST_LENGTH}, inclusive`, |
| 310 | ); |
| 311 | } |
| 312 | } |
| 313 | |
| 314 | /** Extended digest algorithm objects. */ |
| 315 | export type DigestAlgorithmObject = { |
no outgoing calls
no test coverage detected