Skip to content

Commit

Permalink
fixed issue #77
Browse files Browse the repository at this point in the history
  • Loading branch information
BastiaanJansen committed Oct 20, 2023
1 parent 4441c5e commit f4b0631
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,23 +30,23 @@ The following features are supported:
<dependency>
<groupId>com.github.bastiaanjansen</groupId>
<artifactId>otp-java</artifactId>
<version>2.0.2</version>
<version>2.0.3</version>
</dependency>
```

### Gradle
```gradle
implementation 'com.github.bastiaanjansen:otp-java:2.0.2'
implementation 'com.github.bastiaanjansen:otp-java:2.0.3'
```

### Scala SBT
```scala
libraryDependencies += "com.github.bastiaanjansen" % "otp-java" % "2.0.2"
libraryDependencies += "com.github.bastiaanjansen" % "otp-java" % "2.0.3"
```

### Apache Ivy
```xml
<dependency org="com.github.bastiaanjansen" name="otp-java" rev="2.0.2" />
<dependency org="com.github.bastiaanjansen" name="otp-java" rev="2.0.3" />
```

Or you can download the source from the [GitHub releases page](https://github.com/BastiaanJansen/OTP-Java/releases).
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/bastiaanjansen/otp/SecretGenerator.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ private SecretGenerator() {}
public static final int DEFAULT_BITS = 160;

private static final SecureRandom random = new SecureRandom();
private static final Base32 encoder = new Base32();

/**
* Generate an OTP base32 secret with default amount of bits
Expand All @@ -45,7 +46,6 @@ public static byte[] generate(final int bits) {
byte[] bytes = new byte[bits / Byte.SIZE];
random.nextBytes(bytes);

Base32 encoder = new Base32();
return encoder.encode(bytes);
}
}

0 comments on commit f4b0631

Please sign in to comment.