{"id":20103814,"url":"https://github.com/ancientlore/hashsrv","last_synced_at":"2025-05-06T08:31:22.429Z","repository":{"id":36865633,"uuid":"41172602","full_name":"ancientlore/hashsrv","owner":"ancientlore","description":"A web service that performs hashing, encryption, encoding, and compression.","archived":false,"fork":false,"pushed_at":"2025-03-22T15:38:41.000Z","size":149,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-09T10:33:50.744Z","etag":null,"topics":["cryptography","encoding","golang","hashing","webservice"],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ancientlore.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2015-08-21T19:04:19.000Z","updated_at":"2025-03-22T15:38:28.000Z","dependencies_parsed_at":"2023-12-19T17:29:19.924Z","dependency_job_id":"5d14c6a9-cfca-478b-b242-077247764866","html_url":"https://github.com/ancientlore/hashsrv","commit_stats":{"total_commits":50,"total_committers":4,"mean_commits":12.5,"dds":"0.19999999999999996","last_synced_commit":"eed4df9ea0d9f39afa28c1a591e42e2fedd9fa51"},"previous_names":[],"tags_count":30,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ancientlore%2Fhashsrv","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ancientlore%2Fhashsrv/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ancientlore%2Fhashsrv/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ancientlore%2Fhashsrv/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ancientlore","download_url":"https://codeload.github.com/ancientlore/hashsrv/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252648598,"owners_count":21782411,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cryptography","encoding","golang","hashing","webservice"],"created_at":"2024-11-13T17:38:34.889Z","updated_at":"2025-05-06T08:31:22.423Z","avatar_url":"https://github.com/ancientlore.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"![hashsrv](media/logo.png)\n\n**hashsrv** is a web service that performs hashing, encryption, encoding, and compression.\n\n[![Go Reference](https://pkg.go.dev/badge/github.com/ancientlore/hashsrv.svg)](https://pkg.go.dev/github.com/ancientlore/hashsrv)\n\nA [configuration file](hashsrv.config) in [TOML](https://github.com/mojombo/toml) format is used to set up hashsrv,\nbut environment variables and command-line options may be used as well.\n\nUsing hashsrv\n-------------\n\nhashsrv URLs are composed of commands that describe what to do with the given data. For instance, posting data to:\n\n\t/md5/hex\n\nwill calculate the MD5 hash of the posted data, convert it to hex encoding, and respond with the result.\n\nhashsrv implements a simple processing engine that has a stack and a dictionary to store variables. Initially, the data posted via HTTP is pushed onto the stack. Most operations consume data from the stack and push their results onto the stack.\n\nAdditional arguments to operations can be placed onto the stack as literals. For instance, to generate 20 bytes of cryptographically random data and convert it to base64, use:\n\n\t/20/rand/base64\n\nYou should issue a GET request for that because no POST data is required.\n\nItems in the URL that are not keywords are placed onto the stack. At the end of the list of commands, the stack should have a single value to use as the result of the request, or else an error occurs.\n\nNamed variables can be saved and loaded from a dictionary. See the load and save commands. The dictionary is initialized with HTTP headers that begin with `Hashsrv-` (with the prefix removed). So, to pass a variable called `key` into the dictionary, you can send an HTTP header called `Hashsrv-Key`.\n\nAs a convenience, the dictionary is initialized with the following values:\n\n* body - the original request body\n* key - initialized with a default key\n* A number of standard combinations that you can invoke with the `call` command.\n\n### Debug Mode\n\nTo output a debug view instead of the result, add ?debug=1 to the URL.\n\n[Try It!](http://served.ancientlore.io:8080/Hello%20World/32/rand/md5/hmac-md5/hex?debug=1)\n\n### Hash Functions\n\nCommand          | Stack in     | Stack out   | Description\n-----------------|--------------|-------------|--------------------------------------------------------------------------------\nmd5              | Data         | Hash        | Hashes data using [MD5](http://golang.org/pkg/crypto/md5/)\nsha1             | Data         | Hash        | Hashes data using [SHA1](http://golang.org/pkg/crypto/sha1/)\nsha224           | Data         | Hash        | Hashes data using [SHA224](http://golang.org/pkg/crypto/sha256/)\nsha256           | Data         | Hash        | Hashes data using [SHA256](http://golang.org/pkg/crypto/sha256/)\nsha384           | Data         | Hash        | Hashes data using [SHA384](http://golang.org/pkg/crypto/sha512/)\nsha512           | Data         | Hash        | Hashes data using [SHA512](http://golang.org/pkg/crypto/sha512/)\nripemd160        | Data         | Hash        | Hashes data using [RIPEMD160](http://golang.org/x/crypto/ripemd160)\nhmac-md5         | Data, Key    | Hash        | [HMAC](http://golang.org/pkg/crypto/hmac/) hashes data using MD5\nhmac-sha1        | Data, Key    | Hash        | [HMAC](http://golang.org/pkg/crypto/hmac/) hashes data using SHA1\nhmac-sha224      | Data, Key    | Hash        | [HMAC](http://golang.org/pkg/crypto/hmac/) hashes data using SHA2 224-bit\nhmac-sha256      | Data, Key    | Hash        | [HMAC](http://golang.org/pkg/crypto/hmac/) hashes data using SHA2 256-bit\nhmac-sha384      | Data, Key    | Hash        | [HMAC](http://golang.org/pkg/crypto/hmac/) hashes data using SHA2 384-bit\nhmac-sha512      | Data, Key    | Hash        | [HMAC](http://golang.org/pkg/crypto/hmac/) hashes data using SHA2 512-bit\nhmac-ripemd160   | Data, Key    | Hash        | [HMAC](http://golang.org/pkg/crypto/hmac/) hashes data using RIPEMD160\nmd5-len          |              | 16          | Returns the number of bytes for MD5\nsha1-len         |              | 20          | Returns the number of bytes for  SHA1\nsha224-len       |              | 28          | Returns the number of bytes for SHA224\nsha256-len       |              | 32          | Returns the number of bytes for SHA256\nsha384-len       |              | 48          | Returns the number of bytes for SHA384\nsha512-len       |              | 64          | Returns the number of bytes for SHA512\nripemd160-len    |              | 20          | Returns the number of bytes for  RIPEMD160\n\n**Note:** When using HMAC, it is customary to hash the key using the same hash function defined for that version of HMAC. You must do that yourself. For instance, when using hmac-sha256, the key should be hashed with sha256 and then used for HMAC.\n\n### Encoding Functions\n\nCommand          | Stack in     | Stack out   | Description\n-----------------|--------------|-------------|--------------------------------------------------------------------------------\nhex              | Data         | EncodedData | Encode the data as [hex](http://golang.org/pkg/encoding/hex/)\nunhex            | EncodedData  | Data        | Decode the data as [hex](http://golang.org/pkg/encoding/hex/)\nascii85          | Data         | EncodedData | Encode data as [ASCII-85](http://golang.org/pkg/encoding/ascii85/)\nunascii85        | EncodedData  | Data        | Decode data as [ASCII-85](http://golang.org/pkg/encoding/ascii85/)\nbase32           | Data         | EncodedData | Encode data as [BASE-32](http://golang.org/pkg/encoding/base32/)\nunbase32         | EncodedData  | Data        | Decode data as [BASE-32](http://golang.org/pkg/encoding/base32/)\nbase32-hex       | Data         | EncodedData | Encode data as [BASE-32 Hex](http://golang.org/pkg/encoding/base32/)\nunbase32-hex     | EncodedData  | Data        | Decode data as [BASE-32 Hex](http://golang.org/pkg/encoding/base32/)\nbase64           | Data         | EncodedData | Encode data as [BASE-64](http://golang.org/pkg/encoding/base64/)\nunbase64         | EncodedData  | Data        | Decode data as [BASE-64](http://golang.org/pkg/encoding/base64/)\nbase64-url       | Data         | EncodedData | Encode data as [BASE-64 URL](http://golang.org/pkg/encoding/base64/)\nunbase64-url     | EncodedData  | Data        | Decode data as [BASE-64 URL](http://golang.org/pkg/encoding/base64/)\n\n### Checksum Functions\n\nCommand          | Stack in     | Stack out   | Description\n-----------------|--------------|-------------|--------------------------------------------------------------------------------\nadler32          | Data         | Checksum    | Compute the [Adler-32](http://golang.org/pkg/hash/adler32/) checksum\ncrc32            | Data         | Checksum    | Compute the [CRC-32](http://golang.org/pkg/hash/crc32/) checksum using the IEEE polynomial\ncrc32-ieee       | Data         | Checksum    | Compute the [CRC-32](http://golang.org/pkg/hash/crc32/) checksum using the IEEE polynomial\ncrc32-castagnoli | Data         | Checksum    | Compute the [CRC-32](http://golang.org/pkg/hash/crc32/) checksum using the Castagnoli polynomial\ncrc32-koopman    | Data         | Checksum    | Compute the [CRC-32](http://golang.org/pkg/hash/crc32/) checksum using the Koopman polynomial\ncrc64-iso        | Data         | Checksum    | Compute the [CRC-64](http://golang.org/pkg/hash/crc64/) checksum using the ISO polynomial\ncrc64-ecma       | Data         | Checksum    | Compute the [CRC-64](http://golang.org/pkg/hash/crc64/) checksum using the ECMA polynomial\nfnv32            | Data         | Hash        | Compute the [FNV-1](http://golang.org/pkg/hash/fnv/) non-cryptographic hash for 32-bits\nfnv32a           | Data         | Hash        | Compute the [FNV-1a](http://golang.org/pkg/hash/fnv/) non-cryptographic hash for 32-bits\nfnv64            | Data         | Hash        | Compute the [FNV-1](http://golang.org/pkg/hash/fnv/) non-cryptographic hash for 64-bits\nfnv64a           | Data         | Hash        | Compute the [FNV-1a](http://golang.org/pkg/hash/fnv/) non-cryptographic hash for 64-bits\n\n### Compression Functions\n\nCommand          | Stack in     | Stack out   | Description\n-----------------|--------------|-------------|--------------------------------------------------------------------------------\nsnappy           | Data         | Compressed  | Compresses data using the [Snappy](https://code.google.com/p/snappy/) algorithm\nunsnappy         | Compressed   | Data        | Decompresses data using the [Snappy](https://code.google.com/p/snappy/) algorithm\nzlib             | Data         | Compressed  | Compresses data using the [zlib](http://golang.org/pkg/compress/zlib/) algorithm\nunzlib           | Compressed   | Data        | Decompresses data using the [zlib](http://golang.org/pkg/compress/zlib/) algorithm\ndeflate          | Data, Factor | Compressed  | Compresses data using the [flate](http://golang.org/pkg/compress/flate/) algorithm - stack contains a compression factor where -1 is default and 0-9 controls compression (0 is none, and 9 is the most)\ninflate          | Compressed   | Data        | Decompresses data using the [flate](http://golang.org/pkg/compress/flate/) algorithm\ngzip             | Data, Factor | Compressed  | Compresses data using the [gzip](http://golang.org/pkg/compress/gzip/) algorithm - stack contains a compression factor where -1 is default, 0 is none, 1 is best speed, and 9 is best size\nungzip           | Compressed   | Data        | Decompresses data using the [gzip](http://golang.org/pkg/compress/gzip/) algorithm\nunbzip2          | Compressed   | Data        | Decompresses data using the [bzip2](http://golang.org/pkg/compress/bzip2/) algorithm\nlzw-lsb          | Data, Bits   | Compressed  | Compresses data using the [lzw](http://golang.org/pkg/compress/lzw/) algorithm - stack contains the number of bits to use for literal codes, typically 8 but can be 2-8. This version uses least significant bit ordering as used in the GIF file format.\nunlzw-lsb        | Compressed, Bits | Data        | Decompresses data using the [lzw](http://golang.org/pkg/compress/lzw/) algorithm - stack contains the number of bits to use for literal codes, typically 8 but can be 2-8. This version uses least significant bit ordering as used in the GIF file format.\nlzw-msb          | Data, Bits   | Compressed  | Compresses data using the [lzw](http://golang.org/pkg/compress/lzw/) algorithm - stack contains the number of bits to use for literal codes, typically 8 but can be 2-8. This version uses most significant bit ordering as used in the TIFF and PDF file formats.\nunlzw-msb        | Compressed, Bits | Compressed  | Decompresses data using the [lzw](http://golang.org/pkg/compress/lzw/) algorithm - stack contains the number of bits to use for literal codes, typically 8 but can be 2-8. This version uses most significant bit ordering as used in the TIFF and PDF file formats.\n\n### Control Functions\n\nCommand          | Stack in     | Stack out   | Description\n-----------------|--------------|-------------|--------------------------------------------------------------------------------\npush             | Data         | Data, Data  | Duplicates the value on the top of the stack\npop              | Data         |             | Pops the value off the top of the stack (effectively discarding)\nload             | Name         | Value       | Pushes a named value from the dictinary onto the stack\nsave             | Value, Name  |             | Pops a value from the stack and places it into the dictionary\nswap             | Val1, Val2   | Val2, Val1  | Swaps the two values at the top of the stack\nappend           | Val1, Val2   | Appended    | Appends the value on the top of the stack to the previous value on the stack\nslice            | Data         | SliceOfData | Slices the value on the stack, taking elements from start to end on the stack. Use -1 for values from the beginning or end. One example is `/9/20/slice` which takes elements 9 through 19, or `/2/-1/slice` which takes elements 2 through the end.\nlen              | Data         | Data, Length| Pushes the length of the value on the stack in bytes onto the stack\nleft             | Data, Count  | SliceOfData | Takes the leftmost bytes of data\nright            | Data, Count  | SliceOfData | Takes the rightmost bytes of data\nsnip             | Data, Pos    | Data1, Data2| Snips the data in half at the given position, resulting in two values on the stack\neq               | Data1, Data2 |             | Fails the command unless the two data elements are equal\nneq              | Data1, Data2 |             | Fails the command unless the two data elements are not equal\ncall             | Name         | (Varies)    | Loads the named value from the dictionary and executes the commands contained there (formatted like normal - /md5/hex for example)\n\n### Crypto Functions\n\nCommand          | Stack in     | Stack out   | Description\n-----------------|--------------|-------------|--------------------------------------------------------------------------------\nrand             | Count        | Data        | Generates cryptographically [random](http://golang.org/pkg/crypto/rand/) bytes given the count on the stack\naes-blocksize    |              | 16          | Pushes the AES block size on the stack\naes-cfb          | Data, IV, Key| Data        | Encrypts data using the given IV and 16-byte Key, placing the ciphertext back on the stack. Uses [AES](http://golang.org/pkg/crypto/aes/) encryption and the CFB block mode.\nunaes-cfb        | Data, IV, Key| Data        | Decrypts data using the given IV and 16-byte Key, placing the plaintext back on the stack. Uses [AES](http://golang.org/pkg/crypto/aes/) encryption and the CFB block mode.\naes-ofb          | Data, IV, Key| Data        | Encrypts or decrypts data using the given IV and 16-byte Key, placing the result back on the stack. Uses [AES](http://golang.org/pkg/crypto/aes/) encryption and the OFB block mode.\naes-ctr          | Data, IV, Key| Data        | Encrypts or decrypts data using the given IV and 16-byte Key, placing the result back on the stack. Uses [AES](http://golang.org/pkg/crypto/aes/) encryption and the CTR block mode.\ndes-blocksize    |              | 8           | Pushes the DES block size on the stack\ndes-cfb          | Data, IV, Key| Data        | Encrypts data using the given IV and 8-byte Key, placing the ciphertext back on the stack. Uses [DES](http://golang.org/pkg/crypto/des/) encryption and the CFB block mode.\nundes-cfb        | Data, IV, Key| Data        | Decrypts data using the given IV and 8-byte Key, placing the plaintext back on the stack. Uses [DES](http://golang.org/pkg/crypto/des/) encryption and the CFB block mode.\ndes-ofb          | Data, IV, Key| Data        | Encrypts or decrypts data using the given IV and 8-byte Key, placing the result back on the stack. Uses [DES](http://golang.org/pkg/crypto/des/) encryption and the OFB block mode.\ndes-ctr          | Data, IV, Key| Data        | Encrypts or decrypts data using the given IV and 8-byte Key, placing the result back on the stack. Uses [DES](http://golang.org/pkg/crypto/des/) encryption and the CTR block mode.\n3des-blocksize   |              | 8           | Pushes the Triple DES block size on the stack\n3des-cfb         | Data, IV, Key| Data        | Encrypts data using the given IV and 24-byte Key, placing the ciphertext back on the stack. Uses [Triple DES](http://golang.org/pkg/crypto/des/) encryption and the CFB block mode.\nun3des-cfb       | Data, IV, Key| Data        | Decrypts data using the given IV and 24-byte Key, placing the plaintext back on the stack. Uses [Triple DES](http://golang.org/pkg/crypto/des/) encryption and the CFB block mode.\n3des-ofb         | Data, IV, Key| Data        | Encrypts or decrypts data using the given IV and 24-byte Key, placing the result back on the stack. Uses [Triple DES](http://golang.org/pkg/crypto/des/) encryption and the OFB block mode.\n3des-ctr         | Data, IV, Key| Data        | Encrypts or decrypts data using the given IV and 24-byte Key, placing the result back on the stack. Uses [Triple DES](http://golang.org/pkg/crypto/des/) encryption and the CTR block mode.\nblowfish-blocksize|              | 8           | Pushes the blowfish block size on the stack\nblowfish-cfb     | Data, IV, Key| Data        | Encrypts data using the given IV and 1 to 56-byte Key, placing the ciphertext back on the stack. Uses [Blowfish](https://godoc.org/golang.org/x/crypto/blowfish) encryption and the CFB block mode.\nunblowfish-cfb   | Data, IV, Key| Data        | Decrypts data using the given IV and 1 to 56-byte Key, placing the plaintext back on the stack. Uses [Blowfish](https://godoc.org/golang.org/x/crypto/blowfish) encryption and the CFB block mode.\nblowfish-ofb     | Data, IV, Key| Data        | Encrypts or decrypts data using the given IV and 1 to 56-byte Key, placing the result back on the stack. Uses [Blowfish](https://godoc.org/golang.org/x/crypto/blowfish) encryption and the OFB block mode.\nblowfish-ctr     | Data, IV, Key| Data        | Encrypts or decrypts data using the given IV and 1 to 56-byte Key, placing the result back on the stack. Uses [Blowfish](https://godoc.org/golang.org/x/crypto/blowfish) encryption and the CTR block mode.\nblowfish-salt-cfb  | Data, IV, Key, Salt| Data        | Encrypts data using the given IV and 1 to 56-byte Key, placing the ciphertext back on the stack. Uses [Blowfish](https://godoc.org/golang.org/x/crypto/blowfish) encryption and the CFB block mode.\nunblowfish-salt-cfb| Data, IV, Key, Salt| Data        | Decrypts data using the given IV and 1 to 56-byte Key, placing the plaintext back on the stack. Uses [Blowfish](https://godoc.org/golang.org/x/crypto/blowfish) encryption and the CFB block mode.\nblowfish-salt-ofb  | Data, IV, Key, Salt| Data        | Encrypts or decrypts data using the given IV and 1 to 56-byte Key, placing the result back on the stack. Uses [Blowfish](https://godoc.org/golang.org/x/crypto/blowfish) encryption and the OFB block mode.\nblowfish-salt-ctr  | Data, IV, Key, Salt| Data        | Encrypts or decrypts data using the given IV and 1 to 56-byte Key, placing the result back on the stack. Uses [Blowfish](https://godoc.org/golang.org/x/crypto/blowfish) encryption and the CTR block mode.\ntwofish-blocksize|              | 16          | Pushes the twofish block size on the stack\ntwofish-cfb      | Data, IV, Key| Data        | Encrypts data using the given IV and 16, 24, or 32-byte Key, placing the ciphertext back on the stack. Uses [Twofish](https://godoc.org/golang.org/x/crypto/twofish) encryption and the CFB block mode.\nuntwofish-cfb    | Data, IV, Key| Data        | Decrypts data using the given IV and 16, 24, or 32-byte Key, placing the plaintext back on the stack. Uses [Twofish](https://godoc.org/golang.org/x/crypto/twofish) encryption and the CFB block mode.\ntwofish-ofb      | Data, IV, Key| Data        | Encrypts or decrypts data using the given IV and 16, 24, or 32-byte Key, placing the result back on the stack. Uses [Twofish](https://godoc.org/golang.org/x/crypto/twofish) encryption and the OFB block mode.\ntwofish-ctr      | Data, IV, Key| Data        | Encrypts or decrypts data using the given IV and 16, 24, or 32-byte Key, placing the result back on the stack. Uses [Twofish](https://godoc.org/golang.org/x/crypto/twofish) encryption and the CTR block mode.\n\n#### Notes on encryption\n\nThe initialization vector (IV) is used by many routines. It does not need to be kept secure, but it should generally be random and different for each different encryption run. It can easily be generated with the `rand` function. However, you need to keep it for decryption. It is customary to put it at the beginning of the encrypted data. *These routines don't do that for you.*\n\nEach encryption routine supports several [block modes](http://golang.org/pkg/crypto/cipher/). Some of the block modes are symmetrical - so you use the same function to encrypt and decrypt. Others are not.\n\nSome routines require fixed key sizes, others are variable. Keys can be any data. It is usually considered more secure when these keys are relatively random or hashed.\n\n\n### On the todo list\n\n* Control - loop (to go through lines of text and do batch operations)\n* Specialized - protect, unprotect\n\nExamples\n--------\n\nURL                                                     | Result\n--------------------------------------------------------|-----------------------------------------------------------------\nPOST /                                                  | Returns what you posted\nPOST /sha256                                            | Returns SHA256 hash as binary data\nPOST /sha256/hex                                        | Returns SHA256 hash as hex encoding\nPOST /unhex/snappy/hex                                  | Decodes hex data, compresses it using Snappy, and encodes the result to hex\nGET /Hello%20World/32/rand/md5/hmac-md5/hex        | Pushes \"Hello World\" on the stach, generates 32 bytes of random data as the HMAC key (which is then hashed with md5), computes the HMAC-MD5 hash, and converts the result to hex. [Try It!](http://served.ancientlore.io:8080/Hello%20World/32/rand/md5/hmac-md5/hex)\nPOST /MyKeyHere/sha512/hmac-sha512/base64-url                  | Hashes the data with HMAC-SHA512 using the the sha512 hash of the key \"MyKeyHere\" and returns it as base64.\n\nRunning hashsrv\n---------------\n\nAll you need is your configuration file and the hashsrv binary for your platform. You can run it manually or as a service on Windows or Linux (see below).\n\nTo test with the default [configuration file](hashsrv.config) and logging:\n\n\t./hashsrv -run\n\nTo run in the background:\n\n\t./hashsrv -run \u0026\n\nTo keep it running after you log off:\n\n\tnohup ./hashsrv -run \u0026\n\n`nohup` is a Linux utility that keeps a process going after you log off.\n\n### Installation\n\nThe only required files are the hashsrv binary and the configuration file. The hashsrv has minimal dependencies - just a few shared libraries that should already be on the operating system.\n\nOn all operating systems, you may override the configuration file location using the `HASHSRV_CONFIG` environment variable or the `-config` command-line option, which takes precedence. See below for where to place the configuration file when none of these are present.\n\nThe location of the configuration file is based on the location of the hashsrv binary. `/usr/bin` and `/bin` locations are replaced with `/etc` - so effectively, the configuration file is located in the `etc` folder that corresponds to the `bin` folder. If the binary is not in a `bin` folder, then the configuration file is expected to be in the same folder as the binary. Some examples are shown below.\n\n| hashsrv binary location       | Default configuration file location  |\n|-------------------------------|--------------------------------------|\n| /bin/hashsrv                  | /etc/hashsrv.config                  |\n| /usr/bin/hashsrv              | /etc/hashsrv.config                  |\n| /usr/local/bin/hashsrv        | /usr/local/etc/hashsrv.config        |\n| /usr/local/bin/foo/hashsrv    | /usr/local/etc/foo/hashsrv.config    |\n| /usr/local/foo/bin/hashsrv    | /usr/local/foo/etc/hashsrv.config    |\n| c:\\hashsrv\\bin\\hashsrv.exe    | c:\\hashsrv\\etc\\hashsrv.config        |\n| c:\\files\\hashsrv.exe          | c:\\files\\hashsrv.config              |\n| /home/michael/hashsrv         | /home/michael/hashsrv.config         |\n\n### Running as a service\n\nYou can install the hashsrv as a service on Windows or Linux with Upstart. Use the `-install` and `-remove` options to install or remove the hashsrv.\n\n#### Linux\n\nOn Linux, the -install option created a `HashSrv.conf` file in `/etc/init`. To start or stop the hashsrv, you can use:\n\n\tsudo start HashSrv\n\tsudo stop HashSrv\n\nIf the service doesn't start, most likely the configuration file has a problem.\n\n#### Windows\n\nOn Windows, the hashsrv uses the Service API. Use the Service administration tool to start or stop the hashsrv.\n\nAlso, you will need to use the `-run` option if you want to run the application standalone (not as a service).\n\n### Environment Variables\n\n| Option         | Default                    | Description                                              |\n|----------------|----------------------------|----------------------------------------------------------|\n| HASHSRV_CONFIG | hashsrv.config (see above) | Specifies the default location of the configuration file |\n\n\n### Command-Line Parameters\n\n| Option      | Default                             | Description                               | \n|-------------|-------------------------------------|-------------------------------------------|\n| -addr       | \":9009\"                             | Address to serve                          |\n| -config     | HASHSRV_CONFIG environment variable | Use to override the configuration file    |\n| -cpuprofile |                                     | Write CPU profile to file                 |\n| -memprofile |                                     | Write memory profile to file              |\n| -help       | false                               | Show command help                         |\n| -noisy      | false                               | Enable logging                            |\n| -install    | false                               | Install hashsrv as a service              |\n| -remove     | false                               | Remove the hashsrv service                |\n| -run        | false                               | Run hashsrv standalone (not as a service) |\n| -start      | false                               | Start the hashsrv service                 |\n| -stop       | false                               | Stop the hashsrv service                  |\n\n\n### Configuration File Parameters\n\n| Option | Default | Description        |\n|--------|---------|--------------------|\n| addr   | \":9009\" | Web server address |\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fancientlore%2Fhashsrv","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fancientlore%2Fhashsrv","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fancientlore%2Fhashsrv/lists"}