This repository has been archived on 2023-04-04. You can view files and clone it, but cannot push or open issues or pull requests.
2019-01-25 10:43:13 +00:00
|
|
|
import crypto from "crypto";
|
|
|
|
import * as core from "webcrypto-core";
|
|
|
|
import { SubtleCrypto } from "./subtle";
|
|
|
|
|
2020-08-10 11:16:25 +00:00
|
|
|
export class Crypto extends core.Crypto {
|
2019-01-25 10:43:13 +00:00
|
|
|
|
|
|
|
public subtle = new SubtleCrypto();
|
|
|
|
|
|
|
|
public getRandomValues<T extends ArrayBufferView>(array: T): T {
|
|
|
|
const buffer = Buffer.from(array.buffer);
|
|
|
|
crypto.randomFillSync(buffer);
|
|
|
|
return array;
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|