plunkerでsha256 その2
概要
plunkerでsha256やってみた。
参考にしたページ
写真
サンプルコード
function run() {
var src = document.getElementById("src0").value;
let msg = [];
for (let j = 0; j < src.length; j += 2)
{
msg[j / 2] = parseInt(src.substr(j, 2), 16);
}
let hash = compute(padding(msg));
let hs = hash2str(hash);
document.getElementById("code0").value = hs;
var src = document.getElementById("src1").value;
msg = [];
for (j = 0; j < src.length; j += 2)
{
msg[j / 2] = parseInt(src.substr(j, 2), 16);
}
hash = compute(padding(msg));
hs = hash2str(hash);
document.getElementById("code1").value = hs;
var src = document.getElementById("src2").value;
msg = [];
for (j = 0; j < src.length; j += 2)
{
msg[j / 2] = parseInt(src.substr(j, 2), 16);
}
hash = compute(padding(msg));
hs = hash2str(hash);
document.getElementById("code2").value = hs;
}
成果物
function run() {
var src = document.getElementById("src0").value;
let msg = [];
for (let j = 0; j < src.length; j += 2)
{
msg[j / 2] = parseInt(src.substr(j, 2), 16);
}
let hash = compute(padding(msg));
let hs = hash2str(hash);
document.getElementById("code0").value = hs;
var src = document.getElementById("src1").value;
msg = [];
for (j = 0; j < src.length; j += 2)
{
msg[j / 2] = parseInt(src.substr(j, 2), 16);
}
hash = compute(padding(msg));
hs = hash2str(hash);
document.getElementById("code1").value = hs;
var src = document.getElementById("src2").value;
msg = [];
for (j = 0; j < src.length; j += 2)
{
msg[j / 2] = parseInt(src.substr(j, 2), 16);
}
hash = compute(padding(msg));
hs = hash2str(hash);
document.getElementById("code2").value = hs;
}
以上。
Author And Source
この問題について(plunkerでsha256 その2), 我々は、より多くの情報をここで見つけました https://qiita.com/ohisama@github/items/938220cfe5861f19ed85著者帰属:元の著者の情報は、元のURLに含まれています。著作権は原作者に属する。
Content is automatically searched and collected through network algorithms . If there is a violation . Please contact us . We will adjust (correct author information ,or delete content ) as soon as possible .