mirror of
https://codeberg.org/StreamGraph/StreamGraph.git
synced 2024-11-13 19:49:55 +01:00
16 lines
532 B
GDScript
16 lines
532 B
GDScript
extends RefCounted
|
|
|
|
# The result of the authentication string creation process. Use getter for public access.
|
|
var _auth_string: String:
|
|
get = get_auth_string
|
|
|
|
|
|
func _init(password: String, challenge: String, salt: String) -> void:
|
|
var salted := password + salt
|
|
var base64_secret := Marshalls.raw_to_base64(salted.sha256_buffer())
|
|
var b64_secret_plus_challenge = base64_secret + challenge
|
|
_auth_string = Marshalls.raw_to_base64(b64_secret_plus_challenge.sha256_buffer())
|
|
|
|
|
|
func get_auth_string() -> String:
|
|
return _auth_string
|