javascript - 使用 javascript 从字符串返回 SHA-256 哈希
问题描述
我对 javascript 和 HTML 非常陌生。任何帮助表示赞赏。
这是一个简单的网页,旨在从字符串输入中返回 SHA-256。代码已从此处撕下并简化
https://www.fileformat.info/tool/hash.htm
代码
<!DOCTYPE html>
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js" type="text/javascript" ></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/js/bootstrap.min.js"></script>
</head>
<body
<hr />
<legend>String hash</legend>
<form action="hash.htm" class="form-horizontal" method="post" name="theForm">
<fieldset>
<div class="control-group">
<label class="control-label" for="text">Text:</label>
<div class="controls">
<input type="text" class="span12" name="text" value="" />
</div>
</div>
<div class="control-group">
<div class="controls">
<input class="btn btn-primary" type="submit" value="Hash" />
</div>
</div>
</fieldset>
</form>
</div>
</div>
<table class="table table-bordered table-striped table-auto">
<tr>
<th colspan="2">Results</th>
</tr>
<tr>
<td>SHA-256</td>
<td></td>
</tr>
</table>
</body>
</html>
当我将此代码保存为 .html 并使用浏览器打开它,然后尝试返回一个哈希值时,我被带到一个 404 not found 页面。
我敢肯定这很简单!谢谢!
解决方案
推荐阅读
- ios - iOS 在空闲超过 30 秒后快速发送消息
- rocksdb - 在rocksdb中按值排序
- python - 获取python中两个列表中所有元素的总和
- python - 如何在没有 for 循环的情况下将 3D 图像矩阵转换为 2d 矩阵?Python 和 numpy
- flutter - 未定义flutter中的InteractiveViewer类
- django - django rest auth注册中password2如何为空
- python - Python Requests 403 错误在一个环境而不是另一个环境中?
- php - CakePhp 如何在 cakephp3 中以创建形式加载多个上下文
- discord.js - 如何让它为使用指定表情符号对消息做出反应的人添加角色
- javascript - scrollIntoView 不适用于我的反应组件