Skip to content

Commit

Permalink
enhance docs
Browse files Browse the repository at this point in the history
  • Loading branch information
komuw committed Sep 18, 2022
1 parent 3f4986e commit aa8a984
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions enc/enc.go
Original file line number Diff line number Diff line change
Expand Up @@ -153,12 +153,12 @@ func (e Enc) Decrypt(encryptedMsg []byte) (decryptedMsg []byte, err error) {
return aead.Open(nil, nonce, ciphertext, nil)
}

// EncryptEncode is like [Encrypt] except that it returns a string that is encoded using [base64.RawURLEncoding]
// EncryptEncode is like [Enc.Encrypt] except that it returns a string that is encoded using [base64.RawURLEncoding]
func (e Enc) EncryptEncode(plainTextMsg string) (encryptedEncodedMsg string) {
return base64.RawURLEncoding.EncodeToString(e.Encrypt(plainTextMsg))
}

// DecryptDecode takes an encryptedEncodedMsg that was generated using [EncryptEncode] and returns the original un-encrypted string.
// DecryptDecode takes an encryptedEncodedMsg that was generated using [Enc.EncryptEncode] and returns the original un-encrypted string.
func (e Enc) DecryptDecode(encryptedEncodedMsg string) (plainTextMsg string, err error) {
encryptedMsg, err := base64.RawURLEncoding.DecodeString(encryptedEncodedMsg)
if err != nil {
Expand Down

0 comments on commit aa8a984

Please sign in to comment.