Documentation ¶
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Coprime ¶
Coprime returns a random coprime number in [2, N).
Example ¶
package main import ( "fmt" "github.com/itsubaki/rsa/number" ) func main() { p, err := number.Coprime(15) if err != nil { panic(err) } for _, e := range []int{2, 4, 7, 8, 11, 13, 14} { if p == e { fmt.Println("found") break } } }
Output: found
func Euler ¶
Euler returns the Euler's function. p and q must be prime numbers.
Example ¶
package main import ( "fmt" "github.com/itsubaki/rsa/number" ) func main() { e := number.Euler(17, 19) fmt.Println(e) }
Output: 288
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.