Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/geeklearningio/gl-dotnet-d64
[.NET Core 1.1] .NET Standard port of D64, a copy-pastable, URL friendly, ASCII embeddable, lexiographicly sortable binary encoding.
https://github.com/geeklearningio/gl-dotnet-d64
d64 dotnet dotnet-core encoding
Last synced: about 18 hours ago
JSON representation
[.NET Core 1.1] .NET Standard port of D64, a copy-pastable, URL friendly, ASCII embeddable, lexiographicly sortable binary encoding.
- Host: GitHub
- URL: https://github.com/geeklearningio/gl-dotnet-d64
- Owner: geeklearningio
- License: mit
- Created: 2016-06-01T19:39:15.000Z (over 8 years ago)
- Default Branch: develop
- Last Pushed: 2017-01-11T15:35:22.000Z (almost 8 years ago)
- Last Synced: 2024-12-12T11:08:47.780Z (29 days ago)
- Topics: d64, dotnet, dotnet-core, encoding
- Language: C#
- Homepage:
- Size: 19.5 KB
- Stars: 2
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
[![NuGet Version](http://img.shields.io/nuget/v/GeekLearning.D64.svg?style=flat-square)](https://www.nuget.org/packages/GeekLearning.D64/)
[![Build Status](https://geeklearning.visualstudio.com/_apis/public/build/definitions/f841b266-7595-4d01-9ee1-4864cf65aa73/15/badge)](#)# Dotnet D64
This library is a .net standard port of [d64](https://github.com/dominictarr/d64).
d64 is a copy-pastable, url friendly, ascii embeddable, lexiographicly sortable binary encoding.## D64Convert
D64Convert is a class providing feature very similar to native .net `Convert.ToBase64String` and `Convert.FromBase64String()`.
It exposes two static methods.### Encode
```csharp
static string Encode(byte[] data)
```Encode takes a byte array and produces a D64 encoded string.
### Decode
```csharp
static byte[] Decode(string str)
```Decode takes a D64 encoded string and returns the decoded byte array.
## TimeBasedId
TimeBaseId is a sortable likely to be unique id generator. It is similar to guids except that they would be time sortable.
### Constructor
```csharp
TimebasedId(bool reverseOrder)
```You can specify if you want the natural sorting order to be reversed. This might be extremely usefull when using table storage and you want the data to be ordered from most recent to oldest.
### New ID
```csharp
string NewId()
```Generates a new Id based on `DateTimeOffset.UtcNow`.
```csharp
string NewId(DateTimeOffset datetime)
```Generates a new Id using the specified `DateTimeOffset`.
### DateBoundary
```csharp
string DateBoundat(DateTimeOffset datetime)
```
Generates a boundary string which can be used in comparisons to find more recent or older ids.