A Node.js/Express.js REST API to GET and CONVERT binary, hexadecimal, octal, and decimal formats.
Visit https://hexabin.herokuapp.com
Base URL for all endpoints https://hexabin.herokuapp.com/api
Routes | Description |
---|---|
GET /api/:format |
Get a binary, hexadecimal, octal, random, or decimal value. |
Path Parameters-
format
: format to retreive (only: hex, binary, octal, random, or decimal)
Query Parameters-
?length
: length of value
?amount
: amount of values
Example Requests-
GET /api/binary
GET /api/decimal
GET /api/random?amount=2
GET /api/hex?amount=4
GET /api/octal?amount=4&length=3
Example Responses-
{"result":["1101"], "error":false}
{"result":["503"], "error":false}
{"result":["41985","#F38599"], "error":false}
{"result":["#651F54","#B2F4DE","#8A64B2","#5233F1"], "error":false}
{"result":["456","141","620","102"], "error":false}
Routes | Description |
---|---|
GET /api/:from/:fromValue/convert/:to |
Convert values of different formats. |
Path Parameters-
from
: value to convert from (binary, decimal, octal, or hex)
fromValue
: the value of the format to convert from
to
: value to convert to (binary, decimal, octal, or hex)
Example Requests-
GET /api/binary/1010/convert/decimal
GET /api/decimal/12/convert/octal
GET /api/hex/12/convert/binary
GET /api/octal/7435/convert/hex
Example Responses-
{"result":10, "error":false}
{"result":"14", "error":false}
{"result":"10010", "error":false}
{"result":"F1D", "error":false}
- You are retreiving format values for an app or website.
- You are making a quiz game about binary.
- You want to convert octal to binary without doing all the hassle yourself.
Please create a new issue for support and issues.
Please use the BUG_REPORT or FEATURE_REQUEST to submit any issues ot bugs encountered.
Please read the CONTRIBUTING for details on contributing to the Hexabin API.
This project is licensed under MIT. Please read the LICENSE for details.