Convert.FromBase64(Convert)

Converts a base 64 encrypted string back to an unencrypted string. This will be especially useful when needing to pass encrypted data to and from an API.

Applies To

Properties and Methods

None

Available

The .FromBase64(Convert) method is available in:

  • 15.05.081
  • 16.06.032
  • 16.07.005
  • 17.00.002
  • All newer builds

Type

String

Syntax

Convert.FromBase64(Convert);

Parameters

Parameter

Required

Description

String Yes

A Base64 encrypted string

Example

var lcTest = 'imorris:123';

var lcVerifiedB64Value = 'aW1vcnJpczoxMjM=';

var lcResult = Convert.ToBase64(lcTest);

Event.Form.YesNo('Encoded: ' + lcResult + '\r\n Verified Value: ' + lcVerifiedB64Value + '\r\n Match: ' + (lcResult === lcVerifiedB64Value));

lcResult = Convert.FromBase64(lcResult);

Event.Form.YesNo('Decoded: ' + lcResult + '\r\n Original Value: ' + lcTest + '\r\n Match: ' + (lcTest === lcResult));

 

/* First Expected System Prompt Display:

Encoded: aW1vcnJpczoxMjM=

Verified Value: aW1vcnJpczoxMjM=

Match: true

Second Expected System Prompt Display:

Decoded: imorris:123

Original Value: imorris:123

Match: true

*/