npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

xbase-wasm

v0.0.2

Published

<p> <a href="https://www.npmjs.com/package/xbase-wasm" target="_blank"> <img src="https://img.shields.io/npm/v/xbase-wasm?color=orange&logo=npm" /> </a> <a href="https://www.npmjs.com/package/xbase-wasm" target="_blank"> <img src="https://img.shiel

Readme

xbase-wasm

xbase-wasm前端基础功能库

基于Rust和wasm-pack开发的WebAssembly,积累和实现常用基础功能JS库。

为进一步提升web性能,将xframelib库的webworker基础算法功能转为单独的webassembly实现的基础算法库,逐步补充更多基础算法功能。

更新日志

  • v0.0.2 补充使用说明内容;增加fetch_data_json和fetch_data_text方法;
  • v0.0.1 初始版本,实现md5计算、xxtea加密解密基础常用功能;

使用说明

Vite集成使用

  1. 安装vite-plugin-wasm插件

    pnpm add vite-plugin-wasm -D

    import wasm from "vite-plugin-wasm";
    import topLevelAwait from "vite-plugin-top-level-await";
       
    export default defineConfig({
      plugins: [
        wasm(),
        topLevelAwait()
      ]
    });
  2. 安装xbase-wasm

    pnpm add xbase-wasm

应用示例

  1. 测试MD5计算和XXTEA加密与解密

    <template>
        <div>
          <q-input outlined v-model="textRef" label="输入测试文本" />
         <q-btn color="primary" label="计算MD5值" @click="doMD5" />
         <p>{{ md5Value }}</p>
       </div>
        <div>
          <q-input outlined v-model="infoRef" label="输入要加密内容" />
         <q-btn color="primary" label="XXTEA加密" @click="doXXTEAEncode" />
         <p>{{ encodeValue }}</p>
          <q-btn color="secondary" label="XXTEA解密" @click="doXXTEADecode" />
         <p>{{ decodeValue }}</p>   
       </div>
    </template>
       
    <script setup lang="ts">
    import { ref} from 'vue';
    import {md5,xxtea_decrypt_string, xxtea_encrypt_string} from 'xbase-wasm';
       
    const textRef=ref('');
    const md5Value=ref('');
       
    function doMD5()
    {
     md5Value.value= md5(textRef.value);
    }
    const infoRef=ref('');
    const encodeValue=ref('');
    const decodeValue=ref('');
    const key='123456778';
    let result:any;
    function doXXTEAEncode()
    {
       result=  xxtea_encrypt_string(infoRef.value,key);
       console.log('加密后内容:',result);
       encodeValue.value='加密完成';
    }
    function doXXTEADecode()
    {
        if(result)
        {
           decodeValue.value= xxtea_decrypt_string(result,key);   
           encodeValue.value='解密完成';
        }
    }
    </script>
       
  2. 其他

示例截图

MD5计算和XXTEA加密解密

版权声明

xbase-wasm是基于rust开发的前端webassembly基础算法库,任何人都可免费使用,作者不承担任何技术责任。

版权所有 (c) 2025-2030 保留所有权利。

开发作者:[email protected]