UdonSHA2
0.1.1 ・ Public
UdonSHA2
SHA2 implementation for UdonSharp.
Supported hash functions
- SHA-224
- SHA-256
- SHA-384
- SHA-512
- SHA-512/224
- SHA-512/256
Installation
To use this package, you need to add my package repository. Please read more details here.
Please install this package with Creator Companion or VPM CLI.
Creator Companion
-
Enable the
koyashiropackage repository.
-
Find
UdonSHA2from the list of packages and install any version you want.
VPM CLI
-
Execute the following command to install the package.
vpm add package net.koyashiro.udonsha2
Example
using UnityEngine;
using UdonSharp;
using Koyashiro.UdonSHA2;
public class UdonSHA2Sample : UdonSharpBehaviour
{
public void Start()
{
var message = "Hello, world!";
var bytes = new byte[message.Length];
for (var i = 0; i < message.Length; i++)
{
bytes[i] = (byte)message[i];
}
var hash = SHA256.ComputeHash(bytes);
var s = string.Empty;
foreach (var b in hash)
{
s += $"{b:x2}";
}
Debug.Log($"0x{s}"); // 0x315f5bdb76d078c43b8ac0064e4a0164612b1fce77c869345bfc94c75894edd3
}
}
Keywords
No keywords found.Install via VCC
Package ID
net.koyashiro.udonsha2Unity Version
undefinedUnity Release
undefinedVRChat Version
undefinedAuthor
License
MIT
Documentation URL
undefined
Changelog URL
undefined