This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
#first, the most simply method to get a random number is reading embedded $RANDOM variable (range 0...32767) | |
#like this: | |
echo $RANDOM | |
#letters only | |
cat /dev/random | tr -dc 'a-zA-Z' | fold -w $(shuf -i 1-20 -n 1) | head -1 | |
# symbol set / \ number of chars (range) | |
#letters with numbers |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# usage: ./mmi.py -n [NUM] -m [MOD] | |
import sys | |
import argparse | |
import math | |
def gcdExtended(a, b): | |
if b == 0: | |
return a, 1, 0 |