npm.io
3.0.1 • Published yesterday

@nodecfdi/base-converter

Licence
MIT
Version
3.0.1
Deps
0
Size
16 kB
Vulns
0
Weekly
0
Stars
1

@nodecfdi/base-converter

Source Code Npm Node Version Support Discord Latest Version Software License Build Status Reliability Maintainability Code Coverage Violations Total Downloads

TS utility for converting an input from any base to another base the min base this library accepts is 2.

The documentation of this project is in spanish as this is the natural language for intended audience.

La documentación del proyecto está en español porque ese es el lenguaje principal de los usuarios.

Inicio rápido

Instala el paquete con tu gestor de dependencias preferido:

# pnpm
pnpm add @nodecfdi/base-converter

# npm
npm install @nodecfdi/base-converter

# yarn
yarn add @nodecfdi/base-converter

# bun
bun add @nodecfdi/base-converter

Convierte números de cualquier longitud entre distintas bases (por ejemplo, de hexadecimal a decimal o binario):

import { BaseConverter } from '@nodecfdi/base-converter';

const converter = BaseConverter.createBase36();

// Hexadecimal (base 16) a Binario (base 2)
console.log(converter.convert('ffff', 16, 2)); // "1111111111111111"

// Número largo en Hexadecimal (base 16) a Decimal (base 10) sin pérdida de precisión
const input = '3330303031303030303030333030303233373038';
console.log(converter.convert(input, 16, 10)); // "292233162870206001759766198425879490508935868472"

Documentación

La documentación está disponible en el sitio web NodeCfdi

Soporte

Puedes obtener soporte abriendo un ticket en Github.

Compatibilidad

Esta librería se mantendrá compatible con al menos la versión con soporte activo de Node más reciente.

También utilizamos Versionado Semántico 2.0.0 por lo que puedes usar esta librería sin temor a romper tu aplicación.

Contribuciones

Las contribuciones con bienvenidas. Por favor lee CONTRIBUTING para más detalles y recuerda revisar el archivo CHANGELOG.

The @nodecfdi/base-converter library is copyright NodeCfdi and licensed for use under the MIT License (MIT). Please see LICENSE for more information.

Keywords