Skip to content

Commit 075adf2

Browse files
committed
Add a benchmark for generating one-time passwords as strings
1 parent 2146875 commit 075adf2

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/benchmark/java/com/eatthepath/otp/HmacOneTimePasswordGeneratorBenchmark.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,9 @@ public void setUp() throws NoSuchAlgorithmException {
3232
public int benchmarkGenerateOneTimePassword() throws InvalidKeyException {
3333
return this.hotp.generateOneTimePassword(this.key, this.counter++);
3434
}
35+
36+
@Benchmark
37+
public String benchmarkGenerateOneTimePasswordString() throws InvalidKeyException {
38+
return this.hotp.generateOneTimePasswordString(this.key, this.counter++);
39+
}
3540
}

0 commit comments

Comments
 (0)