K. Gopalsamy

12 papers Journal 12
YearRankTypeTitle / Venue / Authors
2011 J jnl
Neural Parallel Sci. Comput.
I. K. C. Leung, K. Gopalsamy
2008 J jnl
Comput. Math. Appl.
Sannay Mohamad, K. Gopalsamy
2006 J jnl
Int. J. Neural Syst.
K. Gopalsamy
2004 J jnl
Appl. Math. Comput.
K. Gopalsamy
2003 J jnl
Appl. Math. Comput.
S. Mohamad, K. Gopalsamy
2002 J jnl
Int. J. Neural Syst.
K. Gopalsamy, S. Mohamad
2002 J jnl
IEEE Trans. Neural Networks
K. Gopalsamy, S. Sariyasa
2000 J jnl
Appl. Math. Comput.
K. Gopalsamy, S. Mohamad
1999 J jnl
Appl. Math. Comput.
Pingzhou Liu, K. Gopalsamy
1998 J jnl
Appl. Math. Comput.
K. Gopalsamy, Issic Kui Chiu Leung, Pingzhou Liu
1997 J jnl
IEEE Trans. Neural Networks
K. Gopalsamy, I. K. C. Leung
1995 J jnl
Neural Parallel Sci. Comput.
K. Gopalsamy, I. K. C. Leung
redb/extractors/decompiler/bninja/utils/hashes.py
← Index redb/extractors/decompiler/bninja/utils/hashes.py python
import hashlib

import tlsh


def calculate_md5(input_str):
    return hashlib.md5(input_str.encode("utf-8")).hexdigest()


def calculate_sha256(input_str):
    """Calculate SHA256 hash of a string."""
    return hashlib.sha256(input_str.encode("utf-8")).hexdigest()

def calculate_tlsh(data):
    """Calculate TLSH fuzzy hash of data if available.

    Args:
        data: The string data to calculate the hash for

    Returns:
        The TLSH hash as a string, or None if not available

    Note:
        TLSH requires at least 50 bytes of data to generate a hash
    """
    try:
        if len(data) >= 50:
            return tlsh.hash(data.encode("utf-8"))
    except Exception:
        pass
    return None