BadScript 2
Loading...
Searching...
No Matches
BadBase64Api.cs
Go to the documentation of this file.
2
4
5[BadInteropApi("Base64")]
6internal partial class BadBase64Api
7{
15 [BadMethod(description: "Encodes the given string to a base64 string")]
16 [return: BadReturn("Base64 String")]
17 private static string Encode([BadParameter(description: "Bytes to Encode")] byte[] obj)
18 {
19 return Convert.ToBase64String(obj);
20 }
21
27 [BadMethod(description: "Decodes a base64 string to an array of bytes")]
28 [return: BadReturn("Bytes")]
29 private static BadArray Decode([BadParameter(description: "String to Decode")] string str)
30 {
31 return new BadArray(Convert.FromBase64String(str).Select(x => (BadObject)(decimal)x).ToList());
32 }
33}
static string Encode([BadParameter(description:"Bytes to Encode")] byte[] obj)
Encodes the given object to a base64 string.
static BadArray Decode([BadParameter(description:"String to Decode")] string str)
Decodes the given base64 string to an array.
Implements a Dynamic List/Array for the BadScript Language.
Definition BadArray.cs:17
The Base Class for all BadScript Objects.
Definition BadObject.cs:14
Contains Compression Extensions and APIs for the BadScript2 Runtime.
Contains the Runtime Objects.
Definition BadArray.cs:10