This commit is contained in:
fabjuuuh
2020-10-19 11:14:05 +02:00
parent 5751bbed81
commit 783c40d7d3
5 changed files with 42 additions and 16 deletions

View File

@@ -54,6 +54,8 @@ namespace Util
return Encoding.ASCII.GetBytes(JsonConvert.SerializeObject(json));
}
public static byte[] LoginAsDoctor(string mUsername, string mPassword)
{
dynamic json = new
@@ -81,13 +83,9 @@ namespace Util
private static string ASCIIBytesToString(byte[] bytes, int offset, int length)
{
unsafe
{
fixed (byte* pAscii = bytes)
{
return new String((sbyte*)pAscii, offset, length);
}
}
byte[] nameArray = new byte[length];
Array.Copy(bytes, offset, nameArray, 0, length);
return Encoding.UTF8.GetString(nameArray);
}
public static bool GetUsernamePassword(byte[] jsonbytes, out string username, out string password)