Created
October 1, 2019 16:12
-
-
Save alickmail/33c359276eaf73db79bede224ac9cd35 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import {assert} from "chai"; | |
import {EncryptionService} from "../Services/EncryptionService"; | |
import * as crypto from 'crypto'; | |
describe('encryption', () => { | |
const encryptionService: EncryptionService = new EncryptionService(); | |
// 1000 * 10 Loops: 5.2 seconds | |
it('encryption performance test', () => { | |
const loop = 1000 * 10; // should use 1000 * 10 | |
const message = Buffer.alloc(1000 * 100); | |
console.time('case1'); | |
for (let i = 0; i < loop; i++) { | |
const signedMessage = encryptionService.signMessage(message); | |
const openedMessage = encryptionService.signOpenMessage(signedMessage); | |
} | |
console.timeEnd('case1'); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment