Skip to content
/ prime Public

Prime is the fast-enough prime number tester and generator. Written in Elixir with no dependency.

License

Notifications You must be signed in to change notification settings

sato11/prime

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Prime

Prime is the fast-enough prime number tester and generator. Written in Elixir with no dependency.

Installation

Add prime to your list of dependencies in mix.exs.

def deps do
  [
    {:prime, "~> 0.1.0"}
  ]
end

Usage

Two functions: generate/1 and test/1. generate/1 takes the bit size.

Prime.generate(2)   # 3, or 2
Prime.generate(8)   # 233, for example
Prime.generate(32)  # 2152342891, zum Beispiel
Prime.generate(512) # s'il vous plaît.

Prime.test(7)   # true
Prime.test(42)  # false
Prime.test(907) # guess it.

Contributing

Feel free.

License

MIT

About

Prime is the fast-enough prime number tester and generator. Written in Elixir with no dependency.

Topics

Resources

License

Stars

Watchers

Forks

Languages