Table of Contents

Class Util

Namespace
TAssetBundle
Assembly
TAssetBundle.dll
public static class Util
Inheritance
Util
Inherited Members

Methods

BytesToHexString(byte[])

Converts a byte array to a hexadecimal string.

public static string BytesToHexString(byte[] bytes)

Parameters

bytes byte[]

Byte array to convert

Returns

string

Hexadecimal string

ClearCachedAssets()

Clears the cached assets.

public static void ClearCachedAssets()

ClearCachedRemoteCatalogs()

Clears cached remote catalogs.

public static void ClearCachedRemoteCatalogs()

Compress(byte[])

Compresses a byte array.

public static byte[] Compress(byte[] inputData)

Parameters

inputData byte[]

Byte array to compress

Returns

byte[]

Compressed byte array

CreateDirectoryFromFilePath(string)

Creates a directory based on the given file path.

public static void CreateDirectoryFromFilePath(string filePath)

Parameters

filePath string

File path

Decompress(byte[])

Decompresses a byte array.

public static byte[] Decompress(byte[] inputData)

Parameters

inputData byte[]

Byte array to decompress

Returns

byte[]

Decompressed byte array

DecryptRijndael(byte[], byte[], byte[])

Decrypts a byte array using Rijndael encryption.

public static byte[] DecryptRijndael(byte[] bytes, byte[] key, byte[] iv)

Parameters

bytes byte[]

Byte array to decrypt

key byte[]

Decryption key

iv byte[]

Initialization vector (IV)

Returns

byte[]

Decrypted byte array

EncryptRijndael(byte[], byte[], byte[])

Encrypts a byte array using Rijndael encryption.

public static byte[] EncryptRijndael(byte[] bytes, byte[] key, byte[] iv)

Parameters

bytes byte[]

Byte array to encrypt

key byte[]

Encryption key

iv byte[]

Initialization vector (IV)

Returns

byte[]

Encrypted byte array

GetAssetBundleName(string, string)

Returns the asset bundle name with hash.

public static string GetAssetBundleName(string assetBundleName, string hash)

Parameters

assetBundleName string

Asset bundle name

hash string

Hash value

Returns

string

Asset bundle name

GetAssetBundleName(string, string, bool)

Returns the asset bundle name with hash if required.

public static string GetAssetBundleName(string assetBundleName, string hash, bool withHash)

Parameters

assetBundleName string

Asset bundle name

hash string

Hash value

withHash bool

Whether to include hash in the name

Returns

string

Asset bundle name

GetDataPath(string)

Returns the data path for a given relative path.

public static string GetDataPath(string relativePath = "")

Parameters

relativePath string

Relative path

Returns

string

Full data path

GetMD5Hash(byte[])

Returns the MD5 hash of a byte array.

public static string GetMD5Hash(byte[] bytes)

Parameters

bytes byte[]

Byte array to compute MD5 hash

Returns

string

MD5 hash string

GetMD5HashFromFile(string)

Returns the MD5 hash of a file at a specified path.

public static string GetMD5HashFromFile(string filePath)

Parameters

filePath string

File path to compute MD5 hash

Returns

string

MD5 hash string

GetMD5HashFromString(string)

Returns the MD5 hash of a string.

public static string GetMD5HashFromString(string inputString)

Parameters

inputString string

String to compute MD5 hash

Returns

string

MD5 hash string

GetSHA256HashFromString(string)

Returns the SHA256 hash of a string.

public static byte[] GetSHA256HashFromString(string inputString)

Parameters

inputString string

String to compute SHA256 hash

Returns

byte[]

SHA256 hash byte array