ChemPare Documentation - v0.0.0
    Preparing search index...

    Function md5sum

    • MD5 hash function that handles various input types. Converts input to string representation before hashing.

      Type Parameters

      • T

      Parameters

      • input: NonNullable<T>

        The input to hash. Can be string, number, object, or null/undefined.

      Returns string | T

      The MD5 hash of the input as a string, or the input itself if null/undefined

      Error if input type is not supported (e.g., Symbol)

      md5sum("hello") // Returns "5d41402abc4b2a76b9719d911017c592"
      md5sum(123) // Returns "202cb962ac59075b964b07152d234b70"
      md5sum({ foo: "bar" }) // Returns hash of stringified object
      md5sum(null) // Returns null