Update Utils

This commit is contained in:
2020-11-24 16:28:54 +01:00
parent 8b95d4b89d
commit cc370ad56b

View File

@@ -9,7 +9,9 @@ namespace WaveshareUARTFingerprintSensor
public static class Utils
{
public static ushort Merge(byte high, byte low) => (ushort)(high << 8 | low);
public static uint Merge(byte first, byte second, byte third) => (uint)(first << 16 | second << 8 | third);
public static (byte high, byte low) Split(ushort value) => ((byte)(value >> 8), (byte)(value & 0xFF));
public static (byte first, byte second, byte third) Split(uint value) => ((byte)(value >> 16 & 0xFF), (byte)(value >> 8 & 0xFF), (byte)(value & 0xFF));
}
}