Quantcast
Channel: Latest Questions by Gillissie
Viewing all articles
Browse latest Browse all 93

C# static class not in Plugins folder

$
0
0

I found this MD5 code somewhere around here. Why won't this work if I don't put it in the Plugins folder? With Javascript I can make classes with static functions & variables and put it anywhere I want in the project and still reference it. I generally stick to Javascript in Unity so I'm not familiar with the quirks of C# in Unity.

using UnityEngine;
using System.Collections;

public class MD5 : MonoBehaviour
{
    public static string encode(string strToEncrypt)
    {
        System.Text.UTF8Encoding ue = new System.Text.UTF8Encoding();
        byte[] bytes = ue.GetBytes(strToEncrypt);

        // encrypt bytes
        System.Security.Cryptography.MD5CryptoServiceProvider md5 = new System.Security.Cryptography.MD5CryptoServiceProvider();
        byte[] hashBytes = md5.ComputeHash(bytes);

        // Convert the encrypted bytes back to a string (base 16)
        string hashString = "";

        for (int i = 0; i 

Viewing all articles
Browse latest Browse all 93

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>