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

base64-mongo-id

v2.0.1

Published

Tiny, browser-compatible mongo id shortener

Downloads

44,596

Readme

Base64 Mongo Id

This library converts mongo ids into base64 strings. It has no dependencies and works in all browsers.

Methods

  • toBase64(mongoIdStr)
    • Input: A Mongo id or 24-character hex string
    • Output: A 16-character base 64 string
  • toHex(shortedIdStr)
    • Input: A 16-character base 64 string
    • Output: A 24-character hex string

Encoding System

The chosen base 64 encoding uses the following system. The characters were chosen to match common base 64 encoding schemes, but to be URL-safe.

  • 0 - A
  • 1 - B
  • 2 - C
  • 3 - D
  • 4 - E
  • 5 - F
  • 6 - G
  • 7 - H
  • 8 - I
  • 9 - J
  • 10 - K
  • 11 - L
  • 12 - M
  • 13 - N
  • 14 - O
  • 15 - P
  • 16 - Q
  • 17 - R
  • 18 - S
  • 19 - T
  • 20 - U
  • 21 - V
  • 22 - W
  • 23 - X
  • 24 - Y
  • 25 - Z
  • 26 - a
  • 27 - b
  • 28 - c
  • 29 - d
  • 30 - e
  • 31 - f
  • 32 - g
  • 33 - h
  • 34 - i
  • 35 - j
  • 36 - k
  • 37 - l
  • 38 - m
  • 39 - n
  • 40 - o
  • 41 - p
  • 42 - q
  • 43 - r
  • 44 - s
  • 45 - t
  • 46 - u
  • 47 - v
  • 48 - w
  • 49 - x
  • 50 - y
  • 51 - z
  • 52 - 0
  • 53 - 1
  • 54 - 2
  • 55 - 3
  • 56 - 4
  • 57 - 5
  • 58 - 6
  • 59 - 7
  • 60 - 8
  • 61 - 9
  • 62 - _
  • 63 - -