string-to-id

0.2.0 • Public • Published

string-to-id

Turns an identifier string (0-9a-z_-) into a unique integer id. Upper-case characters are treated as lower-case.

This package hasn't been tested in production yet, it may currently have collision issues

Why?

This is meant to reduce the amount of bytes transferred for string id's during client-server communication.

Usage

import strtoid from "string-to-id";

strtoid("someId");
// => 2883

Possibility of string collisions

TODO: find out exactly what's the possibility of collisions

There is a possibility of collision.

License

MIT

/string-to-id/

    Package Sidebar

    Install

    npm i string-to-id

    Weekly Downloads

    0

    Version

    0.2.0

    License

    MIT

    Unpacked Size

    10.6 kB

    Total Files

    9

    Last publish

    Collaborators

    • endel