Skip to content

Latest commit

 

History

11 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

danidisp

My public package (on pip) with useful functions i always use
Click here for more information

Installation

pip3 install danidisp

Functions

  • XOR

    xor(a: bytes, b: bytes) -> bytes

    Usage

    from danidisp import xor
    
    >>> print(xor(b'Ciao', b'Ciao')) 
    b'\x00\x00\x00\x00'
  • Discrete logarithm

    dlog(n: int, b: int, mod: int) -> int

    Usage

    from danidisp import dlog
    
    >>> pow(2, 123, 2093)
    372
    >>> logdis(372, 2, 2093)
    123
  • Base Converter

    base_conv(n: str, bs: int = 10, be: int = 10) -> str

    Usage

    from danidisp import base_conv
    
    >>> base_conv('44', 5, 8)
    '30'
    >>> base_conv('30', 8, 5)
    '44'
  • Clock

    @clock
    def func(*param) -> Optional[any]:
      # something...

    Usage

    from danidisp import clock
    
    @clock
    def sum(a: int, b: int) -> int:
      # something to do
    
    res = sum(3, 5)
    assert res[0] == 8
    print(f'sum takes {res[1]:.8f} seconds') 
  • Slow Print

    sprint(string: str, gap: float = GAP_TIME, new_line: bool = True) -> None

    Usage

    from danidisp import sprint
    
    sprint('Hello World!')
  • Slow Input

    sinput(prompt: str) -> None

    Usage

    from danidisp import sinput
    
    username: str = sinput('Insert your username: ')
  • other functions will appear soon...

About

My public package (on pip) with useful functions i always use

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages