https://github.com/guitarrapc/base64urlcore
CLI tool for base64 & base64url encode/decode for URL applications.
https://github.com/guitarrapc/base64urlcore
base64 base64decode base64encode base64url dotnet-global-tool netcore2
Last synced: 4 months ago
JSON representation
CLI tool for base64 & base64url encode/decode for URL applications.
- Host: GitHub
- URL: https://github.com/guitarrapc/base64urlcore
- Owner: guitarrapc
- License: mit
- Created: 2019-02-26T11:39:01.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2020-03-09T14:40:19.000Z (almost 6 years ago)
- Last Synced: 2025-09-06T19:55:49.114Z (5 months ago)
- Topics: base64, base64decode, base64encode, base64url, dotnet-global-tool, netcore2
- Language: C#
- Homepage:
- Size: 93.8 KB
- Stars: 3
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## Base64UrlCore
[](https://circleci.com/gh/guitarrapc/Base64UrlCore) [](https://cloud.drone.io/guitarrapc/Base64UrlCore) [](https://codecov.io/gh/guitarrapc/Base64UrlCore) [](LICENSE)
[](https://www.nuget.org/packages/Base64UrlCore) [](https://www.nuget.org/packages/base64urls)
Converting to, and from, [base64url](https://en.wikipedia.org/wiki/Base64#RFC_4648)
[base64urls](https://www.nuget.org/packages/base64urls) offer you to run [Base64UrlCore](https://www.nuget.org/packages/Base64UrlCore) on the CLI.
## Install
### CLI
```bash
dotnet tool install -g base64urls
```
### Library
```bash
dotnet add package Base64UrlCore
```
## CLI Usage
### SYNTAX
`base64urls [-version] [-help] [encode|decode|escape|unescape] [args]`
### Decode
base64url encode input. Input should be a string or a Buffer.
```bash
$ base64urls decode QyMgaXMgYXdlc29tZQ==
C# is awesome
```
### Encode
Convert a base64url encoded string into a raw string. The encoding argument can be used if the input is a string that's not utf8.
```bash
$ base64urls encode "C# is awesome."
QyMgaXMgYXdlc29tZS4=
```
### Escape
Convert a base64 encoded string to a base64url encoded string.
```bash
$ base64urls escape "This+is/goingto+escape=="
This-is_goingto-escape
```
### Unescape
Convert a base64url encoded string to a base64 encoded string.
```bash
$ base64urls unescape "This-is_goingto-escape"
This+is/goingto+escape==
```
## Library Usage
### Decode
base64url encode input. Input should be a string or a Buffer.
```csharp
Base64Url.Decode("QyMgaXMgYXdlc29tZQ==");
// C# is awesome
```
### Encode
Convert a base64url encoded string into a raw string. The encoding argument can be used if the input is a string that's not utf8.
```csharp
Base64Url.Encode("C# is awesome.");
// QyMgaXMgYXdlc29tZS4=
```
### Escape
Convert a base64 encoded string to a base64url encoded string.
```csharp
Base64Url.Escape("This+is/goingto+escape==");
// "This-is_goingto-escape"
```
### Unescape
Convert a base64url encoded string to a base64 encoded string.
```csharp
Base64Url.Unescape("This-is_goingto-escape");
// "This+is/goingto+escape=="
```
### PadString
Add padding to encoded string.
```csharp
Base64Url.PadString("aG9nZW1vZ2U");
// aG9nZW1vZ2U=
```
### RemovePadding
Remove padding from encoded string.
```csharp
Base64Url.RemovePadding("MQ==");
// MQ
```
## Docker
Library
```
docker build -t base64urlcore . -f Dockerfile.Base64UrlCore
```
global tool
```
docker build -t base64urls . -f Dockerfile.base64urls
```
## CI
Retired appveyor, now using CircleCI.
### Local run
validate ci config.
```
docker run --rm -v $(pwd):/data circleci/circleci-cli:alpine config validate /data/.circleci/config.yml
```
### Code Coverage
Using Coverlet and dotnet-reportgenerator.
Add `coverlet.msbuild` to your csproj, add dotnet global tool `dotnet tool install -g dotnet-reportgenerator-globaltool`, and add environment variables `CODECOV_TOKEN` to CI. (You can find TOKEN at https://codecov.io/gh/guitarrapc/Base64UrlCore)
### NuGet push
Add environment variable `NUGET_KEY` to CI. You can generate it at https://www.nuget.org/account/apikeys.
## License
MIT