WebGLSha3Example.cs 497 B

1234567891011121314151617181920212223
  1. using System;
  2. using System.Collections;
  3. using System.Collections.Generic;
  4. using UnityEngine;
  5. #if UNITY_WEBGL
  6. public class WebGLSha3Example : MonoBehaviour
  7. {
  8. async public void OnHashMessage()
  9. {
  10. try
  11. {
  12. string message = "hello";
  13. string hashedMessage = await Web3GL.Sha3(message);
  14. Debug.Log("Hashed Message :" + hashedMessage);
  15. }
  16. catch (Exception e)
  17. {
  18. Debug.LogException(e, this);
  19. }
  20. }
  21. }
  22. #endif