Returns true or false depending on whether the Invite is valid.
public fun is_invite_valid(invite_code: String, invite_key: String, invite_hash: vector<u8>): bool
Show Implementation
public fun is_invite_valid( invite_code: String, invite_key: String, invite_hash: vector<u8> ): bool { let mut combined = utf8(b""); combined.append(invite_code); combined.append(invite_key); let bytes = into_bytes(combined); let computed_hash_bytes = sha3_256(bytes); let computed_length = computed_hash_bytes.length(); let provided_length = invite_hash.length(); if (computed_length != provided_length) { return false }; let mut index = 0; while (index < computed_length) { if (computed_hash_bytes[index] != invite_hash[index]) { return false }; index = index + 1; }; true }