# tonmi **Repository Path**: tozhang/tonmi ## Basic Information - **Project Name**: tonmi - **Description**: 加密 npm库 - **Primary Language**: NodeJS - **License**: MIT - **Default Branch**: dev - **Homepage**: https://www.npmjs.com/package/tonmi - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2025-09-23 - **Last Updated**: 2025-11-16 ## Categories & Tags **Categories**: Uncategorized **Tags**: sanliehash ## README # tonmi from sanliehash ## DEMO import { tonmi } from 'tonmi'; const test_text = "你好,world"; const test_text02 = "world"; function output_result(value: string, true_value: string) { console.log((value == true_value ? "OK" : "FAIL") + ": " + value); } var x = tonmi.GetMD5("你好"); output_result(x, "7eca689f0d3389d9dea66ae112e5cfd7"); x = tonmi.GetSM3("你好"); output_result(x, "78e5c78c5322ca174089e58dc7790acf8ce9d542bee6ae4a5a0797d5e356be61"); x = tonmi.Base64Encode(test_text); output_result(x, "5L2g5aW977yMd29ybGQ="); x = tonmi.Base64Decode(x); output_result(x, test_text); x = tonmi.EncryptSM4(x, "123"); output_result(x, "5QMLruscpNoitsH4PoFhu4Jc6Z1sABFzgydJR/PccVs="); x = tonmi.DecryptSM4(x, "123"); output_result(x, test_text); x = tonmi.GetSha3_512(x); output_result(x, "455f94bfca52c617d1de1f4b5a530be46de8c08d93d97d84bfcb2498cec50836eca5c87337528bd0d9a9bc5eec31485f66e55d0f9dae5265b4273da3703108d4"); x = tonmi.GetMD6(test_text); output_result(x, "2fccf3045a9a054c7fefe4dfb8fd9343"); x = tonmi.GetMD6_512(test_text); output_result(x, "b871ad16b1bde8a87d0d327d2ca953c30219d8cb65b96a059446964a357b4b1b6ddc3f271bece514c0aa889472a5d7af36697eb22ee8d6a2390d345f55b98476"); x = tonmi.GetADLER32(test_text); output_result(x, "4b1208e8"); x = tonmi.GetADLER64(test_text); output_result(x, "00004b12000008e8"); let zuc = tonmi.GetZUC("test", "hello"); output_result(zuc.NextHex(), "e860314e"); x = tonmi.EncodeHex(tonmi.EncodeMorse(test_text02)); output_result(x, "bb8eee2e8ba8ea"); x = tonmi.DecodeMorse(tonmi.DecodeHex(x)); output_result(x, test_text02);