LoginSignup
0
0

More than 5 years have passed since last update.

smallbasicでsha256

Posted at

自前のエクステンション使います。

サンプル

GraphicsWindow.BackgroundColor = "skyblue"
button = Controls.AddButton("run", 200, 100)
Controls.ButtonClicked = onclick
Sub onclick
  C = Text.GetCharacter(34)
  R = Text.GetCharacter(13) + Text.GetCharacter(10)
  code = ""
  code = code + "Function setup(a)" + R 
  code = code + "str = " + C + "abc" + C + R
  code = code + "Set text = CreateObject(" + C + "System.Text.UTF8Encoding" + C + ")" + R 
  code = code + "Set sha256 = CreateObject(" + C + "System.Security.Cryptography.SHA256Managed" + C + ")" + R 
  code = code + "hac = sha256.ComputeHash_2(text.GetBytes_4(str))" + R 
  code = code + "For i = 1 To LenB(hac)" + R 
  code = code + "b = b & Right(" + C + "0" + C + " & Hex(AscB(MidB(hac, i, 1))), 2)" + R 
  code = code + "Next" + R 
  code = code + "setup = LCase(b)" + R 
  code = code + "msgbox setup" + R
  code = code + "End Function" + R
  a = Class1.VBSrun(code)
EndSub
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0