SHA2 implementation for UdonSharp.
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.
Enable the koyashiro
package repository.
Find UdonSHA2
from the list of packages and install any version you want.
Execute the following command to install the package.
vpm add package net.koyashiro.udonsha2
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
}
}
net.koyashiro.udonsha2
未設定
0.1.1
未設定
なし
なし