# Mtils2
**Repository Path**: mirrors/Mtils2
## Basic Information
- **Project Name**: Mtils2
- **Description**: Mtils2 Mtils是一套前端代码集合,提供常用的数据校验、数据加密、扩展函数、便捷函数
- **Primary Language**: JavaScript
- **License**: BSD-3-Clause
- **Default Branch**: master
- **Homepage**: https://www.oschina.net/p/mtilsjs
- **GVP Project**: No
## Statistics
- **Stars**: 1
- **Forks**: 0
- **Created**: 2020-08-05
- **Last Updated**: 2025-07-26
## Categories & Tags
**Categories**: Uncategorized
**Tags**: None
## README
# Mtils2
Mtils是一套前端代码集合,提供常用的数据校验、数据加密、扩展函数、便捷函数。
Mtils2 is Mtils Upgraded version
[](https://github.com/misterchangray/Mtils2)
[](https://github.com/misterchangray/Mtils2/issues)
[](https://github.com/misterchangray/Mtils2/issues?q=is%3Aissue+is%3Aclosed)
[](./LICENSE)
##### 这是什么
这是一个js的工具集合,封装了常见的表单校验,加密算法,原生函数扩展和一些其他的便捷方法。
详情[参阅API文档](https://misterchangray.github.io/Mtils2/)。
##### 如何下载
- github 上直接下载 released 版本[点击前往](https://github.com/MisterChangRay/Mtils2/releases)
- npm 命令直接安装;`npm install mtils --save-dev`
##### 简介
1. 提供身份证、银行卡、社会信用代码、邮箱、手机、座机、QQ、URL、IP等常见的数据格式校验
2. 提供年龄计算、进制转换、cookie操作、金额格式化、时间格式化、数据类型判断、数组去重、获取拼音等常见便捷方法
3. 提供base64、md5、sha1、sha256、随机数等常见数据安全算法
4. 封装精度更高的计算函数,链式函数调用(类promise),数组对象获取,对象属性设置、对象数组查找
##### 使用示例
1. 引入Mtils.js
```html