plugins/tests/crypto_tests/hash_test.js
Star b6bb3098bc update dao
many other updates
2024-03-24 12:28:02 +08:00

8 lines
448 B
JavaScript

import crypto from "apigo.cloud/git/apigo/plugins/crypto"
if(crypto.md5('hello 123') !== '1bb45824de71b2f6476d800f427cb2ab') throw new Error('md5 error')
if(crypto.sm3('hello 123') !== '4e1f46e2350250d20df71c360852751c8aed29753e6058969602cea8639f7737') throw new Error('sm3 error')
if(crypto.sha256(new Uint8Array([1,2,3,0,254])) !== '39a55ea4bd5dd2fd3818501a1fff9bde99573465a2a5b82c9731f8efd2f0c814') throw new Error('sha256 error')
return true