mirror of
https://github.com/UglyToad/PdfPig.git
synced 2025-04-05 20:55:01 +08:00
Eliminate byte[] allocation in RC4
This commit is contained in:
parent
fba5b60718
commit
ce5dc7c1a1
@ -7,7 +7,7 @@
|
||||
public static byte[] Encrypt(ReadOnlySpan<byte> key, ReadOnlySpan<byte> data)
|
||||
{
|
||||
// Key-scheduling algorithm
|
||||
var s = new byte[256];
|
||||
Span<byte> s = stackalloc byte[256];
|
||||
for (var i = 0; i < 256; i++)
|
||||
{
|
||||
s[i] = (byte)i;
|
||||
|
Loading…
Reference in New Issue
Block a user