There are 2 endpoints that generate hash:
are invoked with POST
the length of the first hash is configured.
After the first hash, a hash is taken to generate another hash, its length is the hash that is taken as a base, the length cannot be changed.
The “timestamp” field is calculated automatically and returned in the response.
POST http://localhost:8080/not-configurable/first-hash
the first hash takes a BigDecimal pivot, pivot is BigDecimal
For the first hash, “previous_order” is null, since there is no previous.
“digits” is the length of the generated hash, an int.
“current_hash” is the new generated hash.
“current_order” in the response is “new_order” in the request.
The order is a logical order like String, each hash has an order.
request
{
"new_order":"abc",
"previous_order": null,
"digits":100,
"pivot":"1.012345678912"
}
response:
{
"timestamp": 1744685700285,
"length": 100,
"current_hash": "_@#_!/#=@--@+-_/%-/@=+%_@**%!+#--!!*@%_%/#/!*@/%#@==%#%%_%%_##/_/-///!*%#*@=_+@_@@!!##%_%%-%@!-*!*#+",
"previous_hash": null,
"current_order": "abc"
}

generate a new hash based on another:
POST http://localhost:8080/not-configurable/new-hash
request:
{
"current_hash": "_@#_!/#=@--@+-_/%-/@=+%_@**%!+#--!!*@%_%/#/!*@/%#@==%#%%_%%_##/_/-///!*%#*@=_+@_@@!!##%_%%-%@!-*!*#+",
"previous_hash":null,
"new_order":"abd"
}
response:
{
"timestamp": 1744685978788,
"length": 100,
"current_hash": "#!+_*=%##-#=_@@!==*/@#_+==__-%_+#/+#@*_%#+=@#++#=-+##_%*-@-!/**-*%#_*==!_!-=-/=#!+!-*@=!%+/___-%@*//",
"previous_hash": "_@#_!/#=@--@+-_/%-/@=+%_@**%!+#--!!*@%_%/#/!*@/%#@==%#%%_%%_##/_/-///!*%#*@=_+@_@@!!##%_%%-%@!-*!*#+",
"current_order": "abd"
}

The link to the repository is:
https://gitlab.com/com.leibnix/hash-apirest
It is a REST API so it listens on port 8080 on localhost.
executes the MyApplication class.
or the direct .jar:



java -jar jueguito-0.0.1-SNAPSHOT.jar

If you have port 8080 busy you must kill the process
Identify the process listening on port 8080:
lsof -i :8080
the output is:
You will have the process number in the PID column
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
java 37101 axelarrondo 9u IPv6 0x937db5c0f698f007 0t0 TCP *:http-alt (LISTEN)
kill the PID
kill -9 37101
