feat: add loading of recommendations to movie page
This commit is contained in:
@@ -47,6 +47,16 @@ export async function fetchStream(url: string, cb: (chunk: string) => void) {
|
||||
}
|
||||
}
|
||||
|
||||
export function hashString(message: string) {
|
||||
let hash = 0;
|
||||
for (let i = 0; i < message.length; i++) {
|
||||
const char = message.charCodeAt(i);
|
||||
hash = ((hash << 5) - hash) + char;
|
||||
hash = hash & hash; // Convert to 32bit integer
|
||||
}
|
||||
return hash;
|
||||
}
|
||||
|
||||
export const createStreamResponse = () => {
|
||||
let controller: ReadableStreamController<ArrayBufferView>;
|
||||
const body = new ReadableStream({
|
||||
|
||||
Reference in New Issue
Block a user