//thinking about apikey inter changing client server
<?php
function base64_sha256(string $s): string {
    // 1. Base64 encode
    $b64 = base64_encode($s);
    // 2. SHA-256 hash
    return hash('sha256', $b64);
}

// Test
$input = "aaaaaaaa"; //ANY YOUR PASSWORD
$result = base64_sha256($input);
echo $result;
// výstup: SHA-256 hash base64 kódu "aaaaaaaa"
?>

extends Node

# Funkcia, ktorá z reťazca urobí Base64 a potom SHA-256
func base64_sha256(s: String) -> String:
    var b64 = s.to_utf8().encode_base64()
    var hash_bytes = Crypto.digest(Crypto.HASH_SHA256, b64.to_utf8())
    return hash_bytes.hex_encode() # prevod na hex string

func _ready():
    var input = "aaaaaaaa"
    var result = base64_sha256(input)
    print(result)
