- More ImRaii
- Cleanup - Spanish, French, Dutch, Chinese loc update
This commit is contained in:
@@ -2,8 +2,10 @@ using System.Text;
|
||||
|
||||
namespace ChatTwo.Util;
|
||||
|
||||
internal static class StringUtil {
|
||||
internal static byte[] ToTerminatedBytes(this string s) {
|
||||
internal static class StringUtil
|
||||
{
|
||||
internal static byte[] ToTerminatedBytes(this string s)
|
||||
{
|
||||
var utf8 = Encoding.UTF8;
|
||||
var bytes = new byte[utf8.GetByteCount(s) + 1];
|
||||
utf8.GetBytes(s, 0, s.Length, bytes, 0);
|
||||
@@ -12,7 +14,8 @@ internal static class StringUtil {
|
||||
}
|
||||
|
||||
// Taken from https://stackoverflow.com/a/4975942
|
||||
internal static string BytesToString(long byteCount) {
|
||||
internal static string BytesToString(long byteCount)
|
||||
{
|
||||
string[] suf = ["B", "KB", "MB", "GB", "TB", "PB", "EB"]; // Longs run out around EB
|
||||
if (byteCount == 0)
|
||||
return "0" + suf[0];
|
||||
|
||||
Reference in New Issue
Block a user