Skip to content

Commit

Permalink
fix: did:web-based alias to load keys (#313)
Browse files Browse the repository at this point in the history
  • Loading branch information
philpotisk authored Jun 6, 2023
1 parent 764edcf commit 32da174
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ class FileSystemHKVStore(configPath: String) : HKVStoreService() {

private fun hashIfNeeded(path: Path): File {
if (path.name.length > configuration.maxKeySize) {
val hashedFileNameBytes = DigestUtils.sha3_512(path.nameWithoutExtension)
val hashedFileNameBytes = DigestUtils.sha3_512(path.name)
val hashedFileName = Base32().encodeToString(hashedFileNameBytes).replace("=", "").replace("+", "")

//val ext = extension
Expand All @@ -64,7 +64,7 @@ class FileSystemHKVStore(configPath: String) : HKVStoreService() {

val newPath = path.parent.resolve(newName)

storeHashMapping(path.nameWithoutExtension, newName)
storeHashMapping(path.name, newName)

logger.debug { "File mapping is hashed: Path was \"${path.absolutePathString()}\", new path is $newPath" }
return dataDirCombinePath(dataDirRelativePath(newPath))
Expand Down

0 comments on commit 32da174

Please sign in to comment.