aboutsummaryrefslogtreecommitdiffstats
path: root/app/src/main/java/com/zeapo/pwdstore/utils/Otp.java
diff options
context:
space:
mode:
authorHarsh Shandilya <msfjarvis@gmail.com>2020-05-10 19:21:39 +0530
committerGitHub <noreply@github.com>2020-05-10 19:21:39 +0530
commit041cf00510a75042223d1857660fc7f1dff958ef (patch)
tree1b56e67e2b71afe23ac51b680b62ad778272f162 /app/src/main/java/com/zeapo/pwdstore/utils/Otp.java
parent94dc92f8d70870b57a7f8c4fe8adef152c1211ce (diff)
downloadHardenedPass-041cf00510a75042223d1857660fc7f1dff958ef.tar.gz
HardenedPass-041cf00510a75042223d1857660fc7f1dff958ef.zip
Treewide codestyle cleanup (#765)
- Updated gitignore and checked in the IDE's codestyle config - Removed spotless as the underlying ktlint backend has failed to resolve the super frustrating import order bug[1] in nearly a year - Reformat the entire codebase based on the previously committed code style configuration. 1: https://github.com/pinterest/ktlint/issues/527
Diffstat (limited to 'app/src/main/java/com/zeapo/pwdstore/utils/Otp.java')
-rw-r--r--app/src/main/java/com/zeapo/pwdstore/utils/Otp.java10
1 files changed, 7 insertions, 3 deletions
diff --git a/app/src/main/java/com/zeapo/pwdstore/utils/Otp.java b/app/src/main/java/com/zeapo/pwdstore/utils/Otp.java
index 21326ed0..07f73423 100644
--- a/app/src/main/java/com/zeapo/pwdstore/utils/Otp.java
+++ b/app/src/main/java/com/zeapo/pwdstore/utils/Otp.java
@@ -4,24 +4,28 @@
*/
package com.zeapo.pwdstore.utils;
+import org.apache.commons.codec.binary.Base32;
+
import java.math.BigInteger;
import java.nio.ByteBuffer;
import java.security.InvalidKeyException;
import java.security.NoSuchAlgorithmException;
import java.util.Arrays;
+
import javax.crypto.Mac;
import javax.crypto.spec.SecretKeySpec;
-import org.apache.commons.codec.binary.Base32;
+
import timber.log.Timber;
public class Otp {
private static final Base32 BASE_32 = new Base32();
- private Otp() {}
+ private Otp() {
+ }
public static String calculateCode(
- String secret, long counter, String algorithm, String digits) {
+ String secret, long counter, String algorithm, String digits) {
String[] steam = {
"2", "3", "4", "5", "6", "7", "8", "9", "B", "C", "D", "F", "G", "H", "J", "K", "M",
"N", "P", "Q", "R", "T", "V", "W", "X", "Y"