2025-06-21 23:30:33 +03:00

20 lines
738 B
JavaScript

"use strict";
// Copyright (C) 2016 Dmitry Chestnykh
// MIT License. See LICENSE file for details.
Object.defineProperty(exports, "__esModule", { value: true });
const system_1 = require("./system");
describe("SystemRandomSource.randomBytes", () => {
const source = new system_1.SystemRandomSource();
it("should generate random bytes", () => {
const len = 64;
const zeros = new Uint8Array(len);
const a = source.randomBytes(len);
const b = source.randomBytes(len);
expect(a.length).toBe(len);
expect(b.length).toBe(len);
expect(a).not.toEqual(b);
expect(a).not.toEqual(zeros);
expect(b).not.toEqual(zeros);
});
});
//# sourceMappingURL=system.test.js.map