Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » Promo codes
- Oisthebestletter
-
Scratcher
100+ posts
Promo codes
I was thinking about adding promo codes to my game, when the thought occurred that they could just use THAT ANNOYING SEE INSIDE button to look at the code. There is hashers, but I don't know how to use them. Can someone explain how to do this?
PS: I am NOT asking you to make a entire hasher. I just want to know how to use it.
PS: I am NOT asking you to make a entire hasher. I just want to know how to use it.
- bsteichman
-
Scratcher
500+ posts
Promo codes
hash functions just take stuff and jumble them up in a predictable way. basically, you input the promo codes into your hashing function and get the code it outputs, putting that into your list which contains your promo codes. When someone types in their code, you convert that code using the same hash, and compare the hashed with the list, rather than the raw data.
hash algorithms like sha-256 are really complicated, so my advice for a simpler one for something that doesn't matter as much as like passwords, is to have a list that converts letters to numbers. A in slot one, B in slot 2, C in slot 3, etc. make sure to include numbers and symbols in this as well.
then jumble these numbers in some predictable way, maybe have a list containing a constant set of random numbers, and swap each item with that number in order. then simply convert that back into text and boom. hash.
I'll try and make a hashing algorithm rq, I'll see if i get back
hash algorithms like sha-256 are really complicated, so my advice for a simpler one for something that doesn't matter as much as like passwords, is to have a list that converts letters to numbers. A in slot one, B in slot 2, C in slot 3, etc. make sure to include numbers and symbols in this as well.
then jumble these numbers in some predictable way, maybe have a list containing a constant set of random numbers, and swap each item with that number in order. then simply convert that back into text and boom. hash.
I'll try and make a hashing algorithm rq, I'll see if i get back
- Oisthebestletter
-
Scratcher
100+ posts
Promo codes
here ya go:Thanks!
https://scratch.mit.edu/projects/1116742765/
- Discussion Forums
- » Help with Scripts
-
» Promo codes