zh-CN 简体中文 项目首页 CDN引入方式 NPM安装 import引入方式 require引入方式 如何使用 在线演示 常见用例 引用hex-converter
hex-converter文档
欢迎广大开发者将此文档翻译为其他语言。
CDN引入方式

<script src="https://unpkg.com/hex-converter@1.0.0/hex-converter.js"></script>

NPM安装

$ npm install hex-converter

import引入方式

import HexConverter from 'path/to/hex-converter';

require引入方式

const HexConverterClass = require("path/to/hex-converter");

如何使用
将数字转换为十六进制字符串

result = HexConverter.int2hex(num);

将十六进制字符串转换为数字

result = HexConverter.hex2int(hex);

将十六进制字符串转换为二进制字符串

result = HexConverter.hex2bin(hex);

将二进制字符串转换为十六进制字符串

result = HexConverter.bin2hex(bin);

将十六进制字符串转换为八进制字符串

result = HexConverter.hex2oct(hex);

将八进制字符串转换为十六进制字符串

result = HexConverter.oct2hex(oct);

将十六进制字符串转换为任意进制字符串

result = HexConverter.hex2any(hex, radix);

将任意进制字符串转换为十六进制字符串

result = HexConverter.any2hex(str, fromRadix);

在线演示
常见用例
数学应用

本项目可以作为数学计算库,嵌入到数学应用中。

程序员编程

程序员通常涉及十六进制、十进制、二进制和八进制之间的相互计算。

编码和解码

本项目支持十六进制和任意进制之间的转换,可用于对敏感数据编码和解码。

引用hex-converter
如果你在学术研究中涉及hex-converter,那么可以按需引用以下内容。
hex-converter源码(BibTeX)

@misc{CNOCTAVE2025, author = {Yu Hongbo, }, title = {hex-converter}, year = {2025}, howpublished = {\url{https://github.com/CNOCTAVE/hex-converter}}, }

hex-converter文档(BibTeX)

@techreport{CNOCTAVE2025, author = {Yu Hongbo, }, title = {hex-converter Document}, institution = {BA DU XIN SHANG}, year = {2025}, number = {16}, month = {6}, url = {https://cnoctave.github.io/hex-converter/index.html}, urldate = {2025-06-16}, }

© 2024-2025 CNOCTAVE © 2024-2025 Yu Hongbo