Skip to content

Latest commit

 

History

29 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DIM Algorithm Plugins (Python)

License PRs Welcome Platform Issues Repo Size Tags Version

Watchers Forks Stars Followers

Dependencies

  • Latest Versions
Name Version Description
Ming Ke Ming (名可名) Version Decentralized User Identity Authentication
Dao Ke Dao (道可道) Version Universal Message Module
DIMP (去中心化通讯协议) Version Decentralized Instant Messaging Protocol

Plugins

  1. Data Coding
    • Base-58
    • Base-64
    • Hex
    • UTF-8
    • JsON
    • PNF (Portable Network File)
    • TED (Transportable Encoded Data)
  2. Digest Digest
    • SHA-256
    • Keccak-256
    • RipeMD-160
  3. Cryptography
    • AES-256 (AES/CBC/PKCS7Padding)
    • RSA-1024 (RSA/ECB/PKCS1Padding), (SHA256withRSA)
    • ECC (Secp256k1)

Plugin Loader

from typing import Optional

from dimp import Base64
from dimap import PluginLoader
from dimap import Base64Coder


class CommonPluginLoader(PluginLoader):

    # Override
    def register_base64_coder(self):
        # Base64 coding
        Base64.coder = _PatchBase64Coder()


# Base-64
class _PatchBase64Coder(Base64Coder):

    # Override
    def decode(self, string: str) -> Optional[bytes]:
        string = self.trim_base64_string(b64=string)
        return super().decode(string=string)

    @staticmethod
    def trim_base64_string(b64: str) -> str:
        if '\n' in b64:
            b64 = b64.replace('\n', '')
            b64 = b64.replace('\r', '')
            b64 = b64.replace('\t', '')
            b64 = b64.replace(' ', '')
        return b64.strip()

This library is primarily designed to implement various algorithms in a plug-in manner, allowing you to further develop additional algorithms tailored to your specific applications.


Copyright © 2018-2026 Albert Moky Followers

About

DIM Plugins (Python)

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages