1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 01:17:35 +00:00

LibWeb: Implement SubtleCrypto.digest()

This is a simple implementation of SubtleCrypto.digest() using LibCrypto
under the hood, so it supports all the required hash functions:
SHA-1, SHA-256, SHA-384, SHA-512.

Two FIXMEs remain: doing the hashing "in parallel", and supporting an
object argument instead of a plain string.
This commit is contained in:
Linus Groh 2021-12-13 22:09:55 +00:00 committed by Andreas Kling
parent 5e06d5e9e5
commit 4daf07e69f
4 changed files with 90 additions and 0 deletions

View file

@ -1,3 +1,5 @@
[SecureContext,Exposed=(Window,Worker)]
interface SubtleCrypto {
// FIXME: Add support for AlgorithmIdentifier ("typedef (object or DOMString)")
Promise<any> digest(DOMString algorithm, BufferSource data);
};