-
Notifications
You must be signed in to change notification settings - Fork 12
Open
Description
https://github.com/AgregoreWeb/website/tree/main/docs/examples/ipfs-pub-sub-chat
Summary: There are two proposed improvements to the current IPFS PUBSUB chat system implementation:
-
Create Room with Topic Name (Hashed) and Auto-Join: When creating a room, the user should input a topic name, which will be hashed into a unique identifier (hex hash). The user should immediately join the room upon creation using this hash.
-
Join Room with Hash Only: To invite others, they will need to enter the room using only the provided hash. A separate "Join Room" button should be added to allow users to input and join rooms by their hash.
This is a static app, so we can use web crypto api, eg:
async function hashRoomName(roomName) {
const encoder = new TextEncoder();
const data = encoder.encode(roomName);
const hashBuffer = await crypto.subtle.digest('SHA-256', data);
const hashArray = Array.from(new Uint8Array(hashBuffer));
const hashHex = hashArray.map(byte => byte.toString(16).padStart(2, '0')).join('');
return hashHex;
}Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels
