Skip to content

Commit 4702f40

Browse files
committed
add: string conversion to LongGuid
1 parent 1fcccff commit 4702f40

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

Scripts/Runtime/Core/LongGuid.cs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,5 +91,16 @@ public static LongGuid FromByteArray(byte[] byteArray)
9191

9292
return new LongGuid(guidValue1, guidValue2);
9393
}
94+
95+
public string ToBase64String()
96+
{
97+
return Convert.ToBase64String(ToByteArray());
98+
}
99+
100+
public static LongGuid FromBase64String(string base64String)
101+
{
102+
byte[] byteArray = Convert.FromBase64String(base64String);
103+
return FromByteArray(byteArray);
104+
}
94105
}
95106
}

0 commit comments

Comments
 (0)