mirror of
https://github.com/pocketbase/pocketbase.git
synced 2024-11-21 13:35:49 +02:00
updated security.Encrypt and security.Decrypt docs
This commit is contained in:
parent
a5eff395b4
commit
be40803d31
8386
plugins/jsvm/internal/types/generated/types.d.ts
vendored
8386
plugins/jsvm/internal/types/generated/types.d.ts
vendored
File diff suppressed because it is too large
Load Diff
@ -8,7 +8,9 @@ import (
|
||||
"io"
|
||||
)
|
||||
|
||||
// Encrypt encrypts data with key (must be valid 32 char aes key).
|
||||
// Encrypt encrypts "data" with the specified "key" (must be valid 32 char AES key).
|
||||
//
|
||||
// This method uses AES-256-GCM block cypher mode.
|
||||
func Encrypt(data []byte, key string) (string, error) {
|
||||
block, err := aes.NewCipher([]byte(key))
|
||||
if err != nil {
|
||||
@ -34,7 +36,9 @@ func Encrypt(data []byte, key string) (string, error) {
|
||||
return result, nil
|
||||
}
|
||||
|
||||
// Decrypt decrypts encrypted text with key (must be valid 32 chars aes key).
|
||||
// Decrypt decrypts encrypted text with key (must be valid 32 chars AES key).
|
||||
//
|
||||
// This method uses AES-256-GCM block cypher mode.
|
||||
func Decrypt(cipherText string, key string) ([]byte, error) {
|
||||
block, err := aes.NewCipher([]byte(key))
|
||||
if err != nil {
|
||||
|
Loading…
Reference in New Issue
Block a user