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 🙏

© 2024 – Pkg Stats / Ryan Hefner

conversion-base

v1.0.0

Published

convert the number to other radix

Downloads

4

Readme

Introduction

将数值转化为不同进制( 2-36 ),对正、负数进行转化

Dependence

JavaScript: String.toString( radix )

Usage

实例化Convert

new Convert( number[,digit] ) number 为想要转化的数值, digit 是将其转化为多少位的2进制补码数。 默认digit为32位

将数值根据radix 进行转化。负数将取其补码的进制。

Covert.prototype.toString( radix )

获取原数值的补码

Covert.prototype.getgetcomplementalCode()

npm install conversion-base --save

import Convert from "conversion-base";

let code1 = new Convert( -998244110 );

code1.toString( 16 )  // C48000F2
code1.getComplementalCode() // 11000100100000000000000011110010

let code2 = new Convert( 998244110 );
code2.toString( 16 )  // 3B7FFF0E
code2.getComplementalCode() // 111011011111111111111100001110

let code3 = new Convert( -10 );
code3.toString( 16 )  // FFFFFFF6
code3.getComplementalCode() // 11111111111111111111111111110110

let code4 = new Convert( -10, 8 );
code4.toString( 16 )  // F6
code4.getComplementalCode() // 11110110

快速开发的插件。有什么 Bug 或者 建议 请提Issue