sm2js

npm i sm2js

Usage no npm install needed!

<script type="module">
  import sm2js from 'https://cdn.skypack.dev/sm2js';
</script>

README

 npm i sm2js
import sm2Encrypt from "sm2js";
var publicKey = "xxx";
sm2Encrypt('需要加密的数据', '公钥', 0)