Utf8Utility 1.0.0

dotnet add package Utf8Utility --version 1.0.0                
NuGet\Install-Package Utf8Utility -Version 1.0.0                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Utf8Utility" Version="1.0.0" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Utf8Utility --version 1.0.0                
#r "nuget: Utf8Utility, 1.0.0"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install Utf8Utility as a Cake Addin
#addin nuget:?package=Utf8Utility&version=1.0.0

// Install Utf8Utility as a Cake Tool
#tool nuget:?package=Utf8Utility&version=1.0.0                

Utf8Utility

Build(.NET) NuGet Azure Artifacts

UTF-8関連のユーティリティライブラリです。

説明

Utf8Utilityは、UTF-8関連処理の実装を詰め合わせたライブラリです。

インストール

NuGet(正式リリース版)

dotnet add package Utf8Utility

Azure Artifacts(開発用ビルド)

dotnet add package Utf8Utility -s https://pkgs.dev.azure.com/finphie/Main/_packaging/DotNet/nuget/v3/index.json

使い方

using System;
using Utf8Utility;
using Utf8Utility.Text;

// stringまたはUTF-8のバイト配列、ReadOnlySpan{char|byte}を指定できます。
var array = new Utf8Array("abc");

var span = array.AsSpan();

// バイト数
var byteCount = array.ByteCount;

// 文字数
var length1 = array.GetLength();
var length2 = UnicodeUtility.GetLength(span);

// 空かどうか
var isEmpty = array.IsEmpty;

// 空か空白文字列かどうか
var isEmptyOrWhiteSpace1 = array.IsEmptyOrWhiteSpace();
var isEmptyOrWhiteSpace2 = UnicodeUtility.IsEmptyOrWhiteSpace(span);

// Ascii文字列かどうか
var isAscii1 = array.IsAscii();
var isAscii2 = UnicodeUtility.IsAscii(span);

// 内部配列への参照
ref var start = ref array.DangerousGetReference();

// 比較
var compareTo = array.CompareTo(array);
var compare1 = Utf8Array.CompareOrdinal(array, array);
var compare2 = Utf8Array.Compare(array, array, StringComparison.CurrentCulture);
var compare3 = UnicodeUtility.Compare(span, span, StringComparison.CurrentCulture);

var empty = Utf8Array.Empty;
var equals = array.Equals(array);
var hash = array.GetHashCode();
var utf16 = array.ToString();

_ = array.TryFormat(stackalloc char[256], out var charsWritten);
_ = array.TryFormat(stackalloc byte[256], out var bytesWritten);

array.CopyTo(stackalloc byte[256]);
_ = array.TryCopyTo(stackalloc byte[256]);

var chars = array.GetChars(stackalloc char[256]);
_ = array.TryGetChars(stackalloc char[256], out var charsWritten);

// Utf8ArrayをキーとしたDictionaryです。
var dict = new Utf8ArrayDictionary<int>();

// キー指定にはUtf8Arrayの他にReadOnlySpan{char|byte}を指定できます。
_ = dict.TryGetValue(array, out var result);
ref var dictStart = ref dict.GetValueRefOrNullRef(array);

_ = dict.TryAdd(array, 1);
dict.Clear();

サポートフレームワーク

  • .NET 8
  • .NET 7
  • .NET Standard 2.1

作者

finphie

ライセンス

MIT

クレジット

このプロジェクトでは、次のライブラリ等を使用しています。

ライブラリ

テスト

アナライザー

ベンチマーク

その他

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 is compatible.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
.NET Core netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.1 is compatible. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on Utf8Utility:

Package Downloads
SimpleTextTemplate.Abstractions

SimpleTextTemplateの抽象化です。

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.0.0 521 9/10/2023
0.13.0 275 3/19/2023
0.12.0 1,038 2/26/2022
0.11.1 2,233 1/10/2022
0.11.0 289 1/8/2022
0.10.0 429 11/7/2021
0.9.1 385 10/21/2021
0.9.0 1,052 10/17/2021
0.8.0 1,422 8/29/2021
0.7.0 429 7/24/2021
0.6.0 433 6/19/2021
0.5.0 964 5/29/2021
0.4.1 408 5/22/2021
0.4.0 958 5/15/2021
0.3.0 448 5/8/2021
0.2.0 420 5/8/2021