added crypto-js for http instance
Prepare Build and Testing executable binary / Prepare-Build-Testing-With-Make (push) Successful in 11s
Prepare Build and Testing executable binary / Prepare-Build-Testing-With-CMake (push) Successful in 13s
Prepare Build and Testing executable binary / Prepare-Build-Testing-With-Meson (push) Successful in 11s
Prepare Build and Testing executable binary / Prepare-Build-Testing-With-Make (push) Successful in 11s
Prepare Build and Testing executable binary / Prepare-Build-Testing-With-CMake (push) Successful in 13s
Prepare Build and Testing executable binary / Prepare-Build-Testing-With-Meson (push) Successful in 11s
This commit is contained in:
+2
-2
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"database": "users.db",
|
||||
"address": "localhost:8222",
|
||||
"tls_address": "localhost:8223",
|
||||
"address": "0.0.0.0:8222",
|
||||
"tls_address": "0.0.0.0:8223",
|
||||
"default_users_file": "users.json",
|
||||
"web": "./web",
|
||||
"tls_enabled": true,
|
||||
|
||||
@@ -215,6 +215,7 @@
|
||||
<tbody id="alluserstablebody"></tbody>
|
||||
</table>
|
||||
</div>
|
||||
<script src="/js/crypto-js.min.js"></script>
|
||||
<script src="/js/security.js"></script>
|
||||
<script src="/js/message.js"></script>
|
||||
<script src="/js/routes.js"></script>
|
||||
|
||||
Vendored
+1
File diff suppressed because one or more lines are too long
+9
-6
@@ -1,8 +1,11 @@
|
||||
const hashPassword = async (password) => {
|
||||
const encoder = new TextEncoder()
|
||||
const data = encoder.encode(password)
|
||||
const hashBuffer = await crypto.subtle.digest('SHA-256', data)
|
||||
const hashArray = Array.from(new Uint8Array(hashBuffer))
|
||||
const hashHex = hashArray.map(b=>('00' + b.toString(16)).slice(-2)).join('')
|
||||
return hashHex
|
||||
if (crypto && crypto.subtle) {
|
||||
const encoder = new TextEncoder()
|
||||
const data = encoder.encode(password)
|
||||
const hashBuffer = await crypto.subtle.digest('SHA-256', data)
|
||||
const hashArray = Array.from(new Uint8Array(hashBuffer))
|
||||
const hashHex = hashArray.map(b=>('00' + b.toString(16)).slice(-2)).join('')
|
||||
return hashHex
|
||||
}
|
||||
return CryptoJS.SHA256(password).toString()
|
||||
}
|
||||
Reference in New Issue
Block a user