MCPcopy Create free account
hub / github.com/Ptechgithub/configs / hashHex_f

Function hashHex_f

worker.js:151–158  ·  view source on GitHub ↗
(string)

Source from the content-addressed store, hash-verified

149}
150
151export async function hashHex_f(string) {
152 const encoder = new TextEncoder();
153 const data = encoder.encode(string);
154 const hashBuffer = await crypto.subtle.digest('SHA-256', data);
155 const hashArray = Array.from(new Uint8Array(hashBuffer));
156 const hashHex = hashArray.map(byte => byte.toString(16).padStart(2, '0')).join('');
157 return hashHex;
158}
159
160/**
161 * Handles VLESS over WebSocket requests by creating a WebSocket pair, accepting the WebSocket connection, and processing the VLESS header.

Callers 1

uuid_validatorFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected