mirror of
https://github.com/adamhathcock/sharpcompress.git
synced 2026-09-22 23:15:20 +00:00
Merge pull request #901 from ms264556/feature/sha256-quick-fix
Handle XZ CheckType SHA-256
This commit is contained in:
@@ -11,7 +11,7 @@ public class XZHeader
|
||||
private readonly byte[] MagicHeader = { 0xFD, 0x37, 0x7A, 0x58, 0x5a, 0x00 };
|
||||
|
||||
public CheckType BlockCheckType { get; private set; }
|
||||
public int BlockCheckSize => ((((int)BlockCheckType) + 2) / 3) * 4;
|
||||
public int BlockCheckSize => 4 << ((((int)BlockCheckType + 2) / 3) - 1);
|
||||
|
||||
public XZHeader(BinaryReader reader) => _reader = reader;
|
||||
|
||||
|
||||
@@ -25,13 +25,10 @@ public sealed class XZStream : XZReadOnlyStream
|
||||
switch (Header.BlockCheckType)
|
||||
{
|
||||
case CheckType.NONE:
|
||||
break;
|
||||
case CheckType.CRC32:
|
||||
break;
|
||||
case CheckType.CRC64:
|
||||
break;
|
||||
case CheckType.SHA256:
|
||||
throw new NotImplementedException();
|
||||
break;
|
||||
default:
|
||||
throw new NotSupportedException("Check Type unknown to this version of decoder.");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user