 0c87e84f25
			
		
	
	0c87e84f25
	
	
	
		
			
			* move stuff out into file transfer manager * obnoxious unsupported version text, adjustments to filetransfermanager * add back file upload transfer progress * restructure code * cleanup some more stuff I guess * downloadids by playername * individual anim/sound bs * fix migration stuff, finalize impl of individual sound/anim pause * fixes with logging stuff * move download manager to transient * rework dl ui first iteration * some refactoring and cleanup * more code cleanup * refactoring * switch to hostbuilder * some more rework I guess * more refactoring * clean up mediator calls and disposal * fun code cleanup * push error message when log level is set to anything but information in non-debug builds * remove notificationservice * move message to after login * add download bars to gameworld * fixes download progress bar * set gpose ui min and max size * remove unnecessary usings * adjustments to reconnection logic * add options to set visible/offline groups visibility * add impl of uploading display, transfer list in settings ui * attempt to fix issues with server selection * add back download status to compact ui * make dl bar fixed size based * some fixes for upload/download handling * adjust text from Syncing back to Uploading --------- Co-authored-by: rootdarkarchon <root.darkarchon@outlook.com> Co-authored-by: Stanley Dimant <stanley.dimant@varian.com>
		
			
				
	
	
		
			36 lines
		
	
	
		
			1.4 KiB
		
	
	
	
		
			C#
		
	
	
	
	
	
			
		
		
	
	
			36 lines
		
	
	
		
			1.4 KiB
		
	
	
	
		
			C#
		
	
	
	
	
	
| using System.Security.Cryptography;
 | |
| using System.Text;
 | |
| using Dalamud.Game.ClientState.Objects.SubKinds;
 | |
| 
 | |
| namespace MareSynchronos.Utils;
 | |
| 
 | |
| public static class Crypto
 | |
| {
 | |
| #pragma warning disable SYSLIB0021 // Type or member is obsolete
 | |
| 
 | |
|     public static string GetFileHash(this string filePath)
 | |
|     {
 | |
|         using SHA1CryptoServiceProvider cryptoProvider = new();
 | |
|         return BitConverter.ToString(cryptoProvider.ComputeHash(File.ReadAllBytes(filePath))).Replace("-", "", StringComparison.Ordinal);
 | |
|     }
 | |
| 
 | |
|     public static string GetHash(this string stringToHash)
 | |
|     {
 | |
|         using SHA1CryptoServiceProvider cryptoProvider = new();
 | |
|         return BitConverter.ToString(cryptoProvider.ComputeHash(Encoding.UTF8.GetBytes(stringToHash))).Replace("-", "", StringComparison.Ordinal);
 | |
|     }
 | |
| 
 | |
|     public static string GetHash256(this string stringToHash)
 | |
|     {
 | |
|         using SHA256CryptoServiceProvider cryptoProvider = new();
 | |
|         return BitConverter.ToString(cryptoProvider.ComputeHash(Encoding.UTF8.GetBytes(stringToHash))).Replace("-", "", StringComparison.Ordinal);
 | |
|     }
 | |
| 
 | |
|     public static string GetHash256(this PlayerCharacter character)
 | |
|     {
 | |
|         using SHA256CryptoServiceProvider cryptoProvider = new();
 | |
|         return BitConverter.ToString(cryptoProvider.ComputeHash(Encoding.UTF8.GetBytes(character.Name + character.HomeWorld.Id.ToString()))).Replace("-", "", StringComparison.Ordinal);
 | |
|     }
 | |
| 
 | |
| #pragma warning restore SYSLIB0021 // Type or member is obsolete
 | |
| } |