I stumbled upon a website filled with engaging JavaScript games and was intrigued by how it saves high scores. The code snippet in question caught my attention:
(new Request({
url: window.location.toString().split("#")[0],
data: {
action: "save_score",
score: this.tenths,
time_started: SERVER_TIME
},
onSuccess: HighScores.updateAndShow.bind(HighScores)
})).send()
However, after achieving a high score and inspecting the request through Chrome developer tools, I noticed an unexpected format of the data:
Form Data
action:save_score
data:115-100-113-115-103-66-49-58-56-63-38-117-126-108-120-118-120-122-116-112-128-112-107-116-116-125-84-72-69-71-53-126-121-120-117-104-104-62-145-90-81-110-133-83-83-145-132-97-93-149-135-139-105-76-107-77-117-132-96-136-105-123-136-87-63-125-95-61-59-77-61-59-59-69-51-114-57-143-148-160-196-115-193-188-188-172-192-186-174-185-185-138-125-115-193-182-186-178-172-192-193-174-191-193-178-177-138-126-128-132-129-133-132-133-133-134-132
The mysterious conversion from "score: this.tenths, time_started: SERVER_TIME" to the string of numbers and dashes perplexes me as I can't trace its origin within the JavaScript codebase.
Could this possibly be a standardized encoding method? Is it perhaps an automatic browser conversion feature? Does this formatting hint at a common Ajax library responsible for generating this sequence of numerical values separated by dashes? Could this data representation serve a security purpose or is it merely a stylistic choice to delimit each number with a dash?
As I plan to implement high scores functionality in my own game, ensuring its resilience against hacking attempts is paramount to me.