Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/python3.3
# -*- coding: utf-8 -*-
# core.py
# Functions:
# [X] ToSend object
# [X] loading servers details
# [ ] loading servers config (in which is found username, etc.)
# [ ] logging to disk commands and status
# [ ] loading and providing configuration e.g. is_enabled()
# -*- coding: utf-8 -*-
# functions_core.py
# Elements:
# [X] IRC exceptions
# [X] sandbox function
# [X] function object
import core
#include "Jacobi.hpp"
void Jacobi::fac2(uintmax_t n, uintmax_t &a, uintmax_t &b)
{
uintmax_t ret_a = 0;
uintmax_t ret_b = n;
while((ret_b&1) == 0)
{
ret_b = ret_b >> 1;
ret_a++;
@suut
suut / RSA.py
Last active August 29, 2015 13:56
#!/usr/bin/python3.3
# -*- coding: utf-8 -*-
import fractions, random
class RSA:
def __init__(self, p, q, b):
self.p = p
self.q = q
self.n = p*q