factorizator.spec.js 529 B

123456789101112131415
  1. const Factorizator = require("../../gramjs/crypto/Factorizator");
  2. describe("calcKey function", () => {
  3. test("it should return 0x20a13b25e1726bfc", () => {
  4. const input = BigInt(
  5. "325672672642762197972197217945794795197912791579174576454600704764276407047277"
  6. );
  7. const { p, q } = Factorizator.factorize(input);
  8. const outP = BigInt(19);
  9. const outQ = BigInt(
  10. "17140666981198010419589327260304989220942778504167082971294773934961916160383"
  11. );
  12. expect([p, q]).toEqual([outP, outQ]);
  13. });
  14. });