voffiee
voffiee
TTCTheo's Typesafe Cult
Created by voffiee on 7/28/2023 in #questions
Wordle - Word selection
I think I was able to solve the issue but thanks for the help! 🙂
38 replies
TTCTheo's Typesafe Cult
Created by voffiee on 7/28/2023 in #questions
Wordle - Word selection
But how would I make it possible for the generateSolution function to not return a Promise but rather the actual value
38 replies
TTCTheo's Typesafe Cult
Created by voffiee on 7/28/2023 in #questions
Wordle - Word selection
Just marked your hash message as the solution
38 replies
TTCTheo's Typesafe Cult
Created by voffiee on 7/28/2023 in #questions
Wordle - Word selection
I know, I haven't worked with promises to much within React
38 replies
TTCTheo's Typesafe Cult
Created by voffiee on 7/28/2023 in #questions
Wordle - Word selection
Could I use some Promise.all() solution?
38 replies
TTCTheo's Typesafe Cult
Created by voffiee on 7/28/2023 in #questions
Wordle - Word selection
What way would be the best to resolve a promise within a React component? Because currently I store the solution as a variable within my "App container" component. The function that generates the solution returns a promise to it because it is async to be able to await crypto
38 replies
TTCTheo's Typesafe Cult
Created by voffiee on 7/28/2023 in #questions
Wordle - Word selection
All good 👍
38 replies
TTCTheo's Typesafe Cult
Created by voffiee on 7/28/2023 in #questions
Wordle - Word selection
The ArrayBuffer needs a number. I'm currently getting this error within the ArrayBuffer constructor
Argument of type 'Uint8Array' is not assignable to parameter of type 'number'.
Argument of type 'Uint8Array' is not assignable to parameter of type 'number'.
38 replies
TTCTheo's Typesafe Cult
Created by voffiee on 7/28/2023 in #questions
Wordle - Word selection
Ohh yeah, true
38 replies
TTCTheo's Typesafe Cult
Created by voffiee on 7/28/2023 in #questions
Wordle - Word selection
So it would be
await crypto.subtle.digest("SHA-256", new ArrayBuffer(new TextEncoder().encode(new Date().getTime())));
await crypto.subtle.digest("SHA-256", new ArrayBuffer(new TextEncoder().encode(new Date().getTime())));
?
38 replies
TTCTheo's Typesafe Cult
Created by voffiee on 7/28/2023 in #questions
Wordle - Word selection
And the "STRING TO HASH" would be the utc date then?
38 replies
TTCTheo's Typesafe Cult
Created by voffiee on 7/28/2023 in #questions
Wordle - Word selection
so then I guess NextJS would be better then a SPA React application?
38 replies
TTCTheo's Typesafe Cult
Created by voffiee on 7/28/2023 in #questions
Wordle - Word selection
Also do you have an example of how the hashing works? I have not worked with hashing stuff to much
38 replies
TTCTheo's Typesafe Cult
Created by voffiee on 7/28/2023 in #questions
Wordle - Word selection
Or am I missing something here?
38 replies
TTCTheo's Typesafe Cult
Created by voffiee on 7/28/2023 in #questions
Wordle - Word selection
Do I really need a server? I have an SPA currently and if I just need to hash the date then it should be fine without a server?
38 replies
TTCTheo's Typesafe Cult
Created by voffiee on 7/28/2023 in #questions
Wordle - Word selection
And that then should make sure that everyone gets the same since it is based of a date, right?
38 replies
TTCTheo's Typesafe Cult
Created by voffiee on 7/28/2023 in #questions
Wordle - Word selection
And I don't want a code snippet to be ran every time someone goes to the page and overwrites the previous solution
38 replies
TTCTheo's Typesafe Cult
Created by voffiee on 7/28/2023 in #questions
Wordle - Word selection
The problem isn't the timestamp part. It is more the fact that I need a way to store the solution once it is generated so that all users get it
38 replies