本文介绍了如何使用javascript将文本转换为哈希的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试为学校项目制作网站,我需要使用javascript将文本转换为哈希。



i登录但没有哈希不能使用它。

事实是我对网站很好,但我对C#很好,这就是为什么javascript

格式化为C#lol。我只需要一个可以传递字符串的函数。

你可以帮助



谢谢



我尝试过:



功能登录()
{
var Pass = document.getElementById(Password)。value;
var User = document.getElementById(Username)。value;
var Key =8C6976E5B5410415BDE908BD4DEE15DFB167A9C873FC4BB8A81F6F2AB448A918//使用SHA256密码admin
var用户名=8C6976E5B5410415BDE908BD4DEE15DFB167A9C873FC4BB8A81F6F2AB448A918//用户名admin以及
if(Pass == Key& User ==用户名)
{
window.open(/ access.html)
}
else
{
alert(这不是正确的用户名或密码);
}
}
解决方案

I am trying to make a webite for a school project and i need to convert text to hash using javascript.

i make the login but without a hash gen i can't use it.
truth is i ant good with websites but i am good with C# thats why the javascript
is formated like C# lol. I just need a function that i can pass the string to.
can you help

thanks

What I have tried:

function Login()
		{
			var Pass = document.getElementById("Password").value;
			var User = document.getElementById("Username").value;
			var Key = "8C6976E5B5410415BDE908BD4DEE15DFB167A9C873FC4BB8A81F6F2AB448A918" // using SHA256 the passwords "admin"
			var Username = "8C6976E5B5410415BDE908BD4DEE15DFB167A9C873FC4BB8A81F6F2AB448A918" // usernames admin as well
			if (Pass == Key & User == Username)
			{
				window.open("/access.html")
			}
			else
			{
				alert("Thats not the right username or password");
			}
		} 
解决方案


这篇关于如何使用javascript将文本转换为哈希的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-20 09:53