Skip to content

Commit

Permalink
Adding JVM overloading for generatePassword (#218)
Browse files Browse the repository at this point in the history
Bumping Java SDK version to 16.2.8
  • Loading branch information
maksimu authored Feb 3, 2022
1 parent 8ffa0bd commit 0d0b227
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion sdk/java/core/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import java.util.*
group = "com.keepersecurity.secrets-manager"

// During publishing, If version ends with '-SNAPSHOT' then it will be published to Maven snapshot repository
version = "16.2.7"
version = "16.2.8"

plugins {
`java-library`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -260,12 +260,10 @@ const val AsciiUppercase = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
const val AsciiDigits = "0123456789"
const val AsciiSpecialCharacters = "\"!@#$%()+;<>=?[]{}^.,"

internal fun randomSample(sampleLength: Int=0, sampleString: String=""): String
{
internal fun randomSample(sampleLength: Int=0, sampleString: String=""): String {
var result = ""
val sampleLen = if (sampleLength < 0) 0 else sampleLength
if (sampleLen > 0 && sampleString.isNotEmpty())
{
if (sampleLen > 0 && sampleString.isNotEmpty()) {
val secureRandom = SecureRandom.getInstanceStrong()
val bytes = CharArray(sampleLen)
result = (bytes.indices)
Expand All @@ -277,6 +275,7 @@ internal fun randomSample(sampleLength: Int=0, sampleString: String=""): String
return result
}

@JvmOverloads
fun generatePassword(
length: Int = 64,
lowercase: Int = 0,
Expand Down

0 comments on commit 0d0b227

Please sign in to comment.