From f43c5014b9698dad72a049b9202c275e80536066 Mon Sep 17 00:00:00 2001 From: alexpantyukhin Date: Thu, 28 Oct 2021 00:38:08 +0400 Subject: [PATCH 1/2] add base 64 --- src/Fable.Python.fsproj | 1 + src/stdlib/Base64.fs | 31 +++++++++++++++++++++++++++++++ 2 files changed, 32 insertions(+) create mode 100644 src/stdlib/Base64.fs diff --git a/src/Fable.Python.fsproj b/src/Fable.Python.fsproj index 9d7b21d..de15717 100644 --- a/src/Fable.Python.fsproj +++ b/src/Fable.Python.fsproj @@ -13,6 +13,7 @@ + diff --git a/src/stdlib/Base64.fs b/src/stdlib/Base64.fs new file mode 100644 index 0000000..1902452 --- /dev/null +++ b/src/stdlib/Base64.fs @@ -0,0 +1,31 @@ +module Fable.Python.Base64 + +open Fable.Core + +// fsharplint:disable MemberNames + +type IExports = + abstract b64encode : byte[] -> byte[] + abstract b64encode : s : byte[] * altchars: byte[] -> byte[] + + abstract b64decode : byte[] -> byte[] + abstract b64decode : string -> byte[] + abstract b64decode : s: byte[] * altchars : byte[] -> byte[] + abstract b64decode : s: string * altchars : byte[] -> byte[] + abstract b64decode : s: byte[] * altchars : byte[] * validate: bool -> byte[] + abstract b64decode : s: string * altchars : byte[] * validate: bool -> byte[] + abstract b64decode : s: byte[] * validate: bool -> byte[] + abstract b64decode : s: string * validate: bool -> byte[] + + abstract standard_b64encode : byte[] -> byte[] + abstract standard_b64decode : string -> byte[] + abstract standard_b64decode : byte[] -> byte[] + abstract urlsafe_b64encode : byte[] -> byte[] + abstract urlsafe_b64decode : string -> byte[] + abstract urlsafe_b64decode : byte[] -> byte[] + abstract b32encode : byte[] -> byte[] + abstract b16encode : byte[] -> byte + + /// Miscellaneous operating system interfaces +[] +let base64: IExports = nativeOnly From 7475b35b711401766430f9048e770b50a3914368 Mon Sep 17 00:00:00 2001 From: alexpantyukhin Date: Thu, 28 Oct 2021 09:22:55 +0400 Subject: [PATCH 2/2] change comment --- src/stdlib/Base64.fs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/stdlib/Base64.fs b/src/stdlib/Base64.fs index 1902452..c8bef26 100644 --- a/src/stdlib/Base64.fs +++ b/src/stdlib/Base64.fs @@ -26,6 +26,6 @@ type IExports = abstract b32encode : byte[] -> byte[] abstract b16encode : byte[] -> byte - /// Miscellaneous operating system interfaces + /// Base16, Base32, Base64, Base85 Data Encodings [] let base64: IExports = nativeOnly