#Go Password Hash
##Setup
- go build main.go
- gofmt -w main.go - To format the code if needed
##Run
- ./main - Start the server
- go test -v - to run tests (Server is started within the tests. Don't need to run ./main.)
##Requirements
- The project should be written in Go using only the standard library.
- When launched it should monitor a given port and wait for http connections.
- When a connection is made it should not respond immediately, but rather hold the socket open for 5 seconds and then respond.
- The connection will be a POST request containing a value that the client wishes to be hashed.
- The hashing algorithm should be SHA512.
- The result should be returned base64 encoded.
- The software should be able to process multiple connections simultaneously.
- If, instead of a password request the software receives a "graceful shutdown" request, it should allow any remaining password requests to complete, reject any new requests, and shutdown.
- No additional password requests should be allowed when shutdown is pending.
##Example For instance, given the request (generated by curl): curl --data "password=angryMonkey" http://localhost:8080
Your program should return ZEHhWB65gUlzdVwtDQArEyx+KVLzp/aTaRaPlBzYRIFj6vjFdqEb0Q5B8zVKCZ0vKbZPZklJz0Fd7su2A+gf7Q==
##Asumptions
- Status code 400 'Bad Form Parameter' is returned if the form key is not "password"
- Status code 404 'Not Found' is returned on any request other than a POST
##More to do
- Graceful shutdown and corresponding tests
- Test for multiple asynchronous requests