mirror of
https://github.com/pocketbase/pocketbase.git
synced 2026-10-10 00:07:27 +02:00
[#114] simplified some code by returning early and added cap for slices
This commit is contained in:
1 parent
03a7bafa66
commit
a16b0c9004
11 files changed
+124
-147
No files matched your search
@@ -66,10 +66,5 @@ func Decrypt(cipherText string, key string) ([]byte, error) {
|
||||
}
|
||||
|
||||
nonce, cipherByteClean := cipherByte[:nonceSize], cipherByte[nonceSize:]
|
||||
plainData, err := gcm.Open(nil, nonce, cipherByteClean, nil)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return plainData, nil
|
||||
return gcm.Open(nil, nonce, cipherByteClean, nil)
|
||||
}
|
||||
Reference in new issue
Block a user