public static unsafe void HashData(this IHashInstance hash, byte[] data) { fixed(byte *prt = data) { hash.HashData(prt, data.Length); } }
public unsafe static void InterimHash(this IHashInstance instance, byte[] hash) { fixed(byte *ptr = hash) { instance.InterimHash(ptr, hash.Length); } }
public static void HashData(this IHashInstance hash, ReadableBuffer dataToHash) { foreach (var m in dataToHash) { hash.HashData(m); } }
public static unsafe void HashData(this IHashInstance hash, Memory <byte> dataToHash) { GCHandle handle; var ptr = dataToHash.GetPointer(out handle); try { hash.HashData((byte *)ptr, dataToHash.Length); } finally { if (handle.IsAllocated) { handle.Free(); } } }