Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
clean-platform
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
15
Issues
15
List
Boards
Labels
Service Desk
Milestones
Merge Requests
2
Merge Requests
2
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
clean-and-itasks
clean-platform
Commits
1aeb73b1
Verified
Commit
1aeb73b1
authored
Aug 17, 2019
by
Camil Staps
🚀
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add properties to Text.Encodings.Base64
parent
7f54538b
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
4 deletions
+20
-4
src/libraries/OS-Independent/Text/Encodings/Base64.dcl
src/libraries/OS-Independent/Text/Encodings/Base64.dcl
+20
-4
No files found.
src/libraries/OS-Independent/Text/Encodings/Base64.dcl
View file @
1aeb73b1
definition
module
Text
.
Encodings
.
Base64
/*
/*
*
* Base64 and Base64URL encoding/decoding according to RFC4648. More info:
* - http://tools.ietf.org/html/rfc4648
* - http://en.wikipedia.org/wiki/Base64
*
* @property-bootstrap
* import StdEnv
* import Text
*/
::
Length
:==
Int
...
...
@@ -13,21 +17,33 @@ definition module Text.Encodings.Base64
/**
* Converts a String to a Base64-encoded String.
* @property inverse: A.x :: String:
* base64Decode (base64Encode x) == x
*/
base64Encode
::
!.
String
->
.
String
/**
* Converts a String to a Base64-encoded String given a maximum line length.
* @property inverse: A.len :: Int; x :: String:
* len > 0 ==> base64Decode (base64EncodeLen x len) == x
* @property max length: A.len :: Int; x :: String:
* len > 0 ==> all ((>=) len o size) (split "\n" (base64EncodeLen x len))
*/
base64EncodeLen
::
!.
String
!
Length
->
.
String
/**
* Converts a String to an URL-safe Base64-encoded String.
* @property inverse: A.x :: String:
* base64URLDecode (base64URLEncode x) == x
*/
base64URLEncode
::
!.
String
->
.
String
/**
* Converts a String to an URL-safe Base64-encoded String given a maximum line length.
* @property inverse: A.len :: Int; x :: String:
* len > 0 ==> base64URLDecode (base64URLEncodeLen x len) == x
* @property max length: A.len :: Int; x :: String:
* len > 0 ==> all ((>=) len o size) (split "\n" (base64URLEncodeLen x len))
*/
base64URLEncodeLen
::
!.
String
!
Length
->
.
String
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment