You won’t get MD5 or SHA1 quality in just tens of lines without a library, but a simple rolling hash or XOR-based function can give you a decent 32-character hex string output.
It’s great for non-secure uses like caching keys or indexing.
If you want, I can share a snippet that hashes strings into hex easily!