base52

1.0.1 • Public • Published

Convert digits (integer) to alphabetical character and vice versa

It's useful to hide object id in url, for example instead of integer number 1 /article/comments/1 use base52 encoder to show b

Numbers beginning from a that equals 0 and Z that equals 51;

Installation with NPM

npm i base52

Usage syntax

const x = require('base52');

console.log(x.base52Decode('srLweV')); // output: 17902030294
console.log(x.base52Encode(98346982)); // output: gWwxn

VUEJs Mixin

import HelloWorld from './components/HelloWorld.vue'
import {VueBase52Mixin} from 'base52'

export default {
  name: 'App',
  components: {
    HelloWorld,
  },
  mixins: [VueBase52Mixin]

Readme

Keywords

none

Package Sidebar

Install

npm i base52

Weekly Downloads

2

Version

1.0.1

License

ISC

Unpacked Size

2.58 kB

Total Files

3

Last publish

Collaborators

  • mh828