diff options
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.java | 10 |
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" |
