Skip to content

Commit

Permalink
Secret new implementation (#90)
Browse files Browse the repository at this point in the history
* Improve Secret memory usage

* Refactoring Secret internal

* Add isEquals
  • Loading branch information
geirolz authored Jan 12, 2024
1 parent 1c1f26f commit fba810d
Show file tree
Hide file tree
Showing 7 changed files with 419 additions and 147 deletions.
6 changes: 6 additions & 0 deletions .scalafmt.conf
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,12 @@ newlines.alwaysBeforeElseAfterCurlyIf = false
rewrite.rules = [RedundantParens, SortImports]
rewrite.redundantBraces.stringInterpolation = true

docstrings.style = SpaceAsterisk
docstrings.oneline = fold
docstrings.removeEmpty = true
docstrings.blankFirstLine = no
docstrings.forceBlankLineBefore = true

spaces.inImportCurlyBraces = false

fileOverride {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package com.geirolz.app.toolkit.config

import java.nio.ByteBuffer
import java.util

private[config] object BytesUtils {

def clearByteArray(bytes: Array[Byte]): Null = {
util.Arrays.fill(bytes, 0.toByte)
null
}

def clearByteBuffer(buffer: ByteBuffer): Null = {
val zeroBytesArray = new Array[Byte](buffer.capacity())
util.Arrays.fill(zeroBytesArray, 0.toByte)
buffer.clear()
buffer.put(zeroBytesArray)
null
}
}
Loading

0 comments on commit fba810d

Please sign in to comment.