Spring Boot app that generates prime numbers using different algorithms
This is a Spring Boot backend web API
- Java
- Spring Boot
- JUnit
The main features are:
- Calculate prime numbers up to a given number and using a selected algorithm
- Returns the prime numbers in JSON or XML format
Call the web API to get the prime numbers in JSON format:
/primesjson?n=x&algorithm=y
where n is the number to generate prime numbers to and algorithm (optional) is either 1, 2 or 3 (1 = Sieve of Eratosthenes, 2 = Java 8, 3 = Brute force).
The prime numbers are returned in JSON format:
[2,3,5,7, ...]
Call the web API to get the prime numbers in XML format:
/primesxml?n=x&algorithm=y
where n is the number to generate prime numbers to and algorithm (optional) is either 1, 2 or 3 (1 = Sieve of Eratosthenes, 2 = Java 8, 3 = Brute force).
The prime numbers are returned in XML format:
<List>
<item>2</item>
<item>3</item>
<item>5</item>
<item>7</item>
</List>Project is: complete
Created by @ostenlun - feel free to contact me!
This project is open source and available under the MIT License.