summaryrefslogtreecommitdiff
path: root/LibTSforge/TokenStore/TokenStoreModern.cs
diff options
context:
space:
mode:
authorWither OrNot2025-04-07 23:23:19 +0000
committerWither OrNot2025-04-07 23:23:19 +0000
commitb7868ff296016917c38657474117d5ca820b2312 (patch)
tree5c3dd53fe258c322c14dc2d69b8864a98de91a4a /LibTSforge/TokenStore/TokenStoreModern.cs
parentcb5c97d443982e547a8dd5a76032de8fa6859b61 (diff)
parent3a3ac06ca3715127475c7a2c7b3f0782e1690dfb (diff)
downloadTSforge-b7868ff296016917c38657474117d5ca820b2312.zip
Merge branch 'longhorn' of https://github.com/massgravel/TSforge into longhorn1.1.0-longhorn+1
Diffstat (limited to 'LibTSforge/TokenStore/TokenStoreModern.cs')
-rw-r--r--LibTSforge/TokenStore/TokenStoreModern.cs14
1 files changed, 4 insertions, 10 deletions
diff --git a/LibTSforge/TokenStore/TokenStoreModern.cs b/LibTSforge/TokenStore/TokenStoreModern.cs
index ee51e7a..2ced532 100644
--- a/LibTSforge/TokenStore/TokenStoreModern.cs
+++ b/LibTSforge/TokenStore/TokenStoreModern.cs
@@ -4,7 +4,7 @@ namespace LibTSforge.TokenStore
using System.Collections.Generic;
using System.IO;
using System.Linq;
- using LibTSforge.Crypto;
+ using Crypto;
public class TokenStoreModern : ITokenStore
{
@@ -18,7 +18,7 @@ namespace LibTSforge.TokenStore
private static readonly byte[] CONTS_FOOTER = Enumerable.Repeat((byte)0xAA, 0x20).ToArray();
private List<TokenEntry> Entries = new List<TokenEntry>();
- public FileStream TokensFile;
+ private readonly FileStream TokensFile;
public void Deserialize()
{
@@ -40,7 +40,7 @@ namespace LibTSforge.TokenStore
uint contentOffset = reader.ReadUInt32();
uint contentLength = reader.ReadUInt32();
uint allocLength = reader.ReadUInt32();
- byte[] contentData = new byte[] { };
+ byte[] contentData = { };
if (populated)
{
@@ -140,11 +140,10 @@ namespace LibTSforge.TokenStore
writer.WritePadding(BLOCK_PAD_SIZE);
writer.BaseStream.Seek(curBlockOffset, SeekOrigin.Begin);
- byte[] blockHash;
byte[] blockData = new byte[BLOCK_SIZE - 0x20];
tokens.Read(blockData, 0, BLOCK_SIZE - 0x20);
- blockHash = CryptoUtils.SHA256Hash(blockData);
+ byte[] blockHash = CryptoUtils.SHA256Hash(blockData);
writer.BaseStream.Seek(curBlockOffset + BLOCK_SIZE - 0x20, SeekOrigin.Begin);
writer.Write(blockHash);
@@ -275,11 +274,6 @@ namespace LibTSforge.TokenStore
Deserialize();
}
- public TokenStoreModern()
- {
-
- }
-
public void Dispose()
{
Serialize();