Hashids.js Versions Save

A small JavaScript library to generate YouTube-like ids from numbers.

2.2.2

3 years ago

2.2.2 (2020-11-07)

Bug Fixes

2.2.1

4 years ago

2.2.1 (2020-02-04)

Bug Fixes

  • avoid string spread so that TypeScript typings do not require downlevelIteration when targetting ES5 (f6bd32c), closes #171
  • rework conditional exports to allow requiring index file directly (b2da180), closes #207

2.2.0

4 years ago

2.2.0 (2020-02-03)

Bug Fixes

  • use arrays internally to improve performance (0ab8b88), closes #79

Features

  • tune performance by switching to RegExps and reducing iteration (b395f3d)

2.1.0

4 years ago

2.1.0 (2019-11-09)

Bug Fixes

  • protect from an infinite loop by validating IDs (bc5b9cf), closes #126

Features

  • add a public method hashids.isValidId(id) that validates the ID (7be1bda)

2.0.1

4 years ago

2.0.1 (2019-09-06)

Bug Fixes

  • use type error when needed (b018557)

2.0.0

4 years ago

2.0.0 (2019-08-31)

BREAKING CHANGES

  • when used from Node (without ESM enabled), you now need to require('hashids/cjs')
  • constructor: we now expect salt and alphabet to be valid strings and minLength to be a valid number (if any are provided)
  • Hashids now throws errors when being constructed with incorrect options (previously, it silently fallbacked to defaults)

Bug Fixes

  • extract BigInt test cases so they don't throw in unsupported envs (20f3df1)

Code Refactoring

  • constructor: simplify constructor & extract 'shuffle' (85c7f49)

Features

  • transparent support of BigInts. If your environment supports them, you can use the standard API to encode and decode them. Note that trying to decode a BigInt hashid on an unsupported environment will throw an error. Fixes #58. (df2c831)
  • lifted the limitation that the alphabet cannot contain spaces (df2c831)
  • both the alphabet and salt may now contain multi-byte characters (e.g. for an emoji-based alphabet) (526b6ca)
  • it is now possible to provide custom seps (e.g. to avoid custom curses). Fixes #17.

Chores

  • upgraded all dependencies
  • tests now use jest testing framework
  • extracted static methods to helper functions
  • converted the implementation to TypeScript
  • added prettier
  • added stricter eslint rules
  • added semantic-release for automated releases

2.0.0-prerelease.4@next

4 years ago

2.0.0-prerelease.4 (2019-08-17)

Bug Fixes

  • only run the esm importing test on node >= 12 (e9aebcf)

2.0.0-prerelease.3@next

4 years ago

2.0.0-prerelease.3 (2019-08-15)

Bug Fixes

  • build: add TypeScript re-export typings (875bb27)

2.0.0-prerelease.1@next

4 years ago

2.0.0-prerelease.1 (2019-08-15)

BREAKING CHANGES

  • when used from Node (without ESM enabled), you now need to require('hashids/cjs')
  • constructor: we now expect salt and alphabet to be valid strings and minLength to be a valid number (if any are provided)
  • Hashids now throws errors when being constructed with incorrect options (previously, it silently fallbacked to defaults)

Bug Fixes

  • extract BigInt test cases so they don't throw in unsupported envs (20f3df1)

Code Refactoring

  • constructor: simplify constructor & extract 'shuffle' (85c7f49)

Features

  • transparent support of BigInts. If your environment supports them, you can use the standard API to encode and decode them. Note that trying to decode a BigInt hashid on an unsupported environment will throw an error. Fixes #58. (df2c831)
  • lifted the limitation that the alphabet cannot contain spaces (df2c831)
  • both the alphabet and salt may now contain multi-byte characters (e.g. for an emoji-based alphabet) (526b6ca)
  • it is now possible to provide custom seps (e.g. to avoid custom curses). Fixes #17.

Chores

  • upgraded all dependencies
  • tests now use jest testing framework
  • extracted static methods to helper functions
  • converted the implementation to TypeScript
  • added prettier
  • added stricter eslint rules
  • added semantic-release for automated releases