GitPedia
niieani

niieani/hashids.js

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

19 Releases
Latest: 3y ago
2.3.0Latest
github-actions[bot]github-actions[bot]·3y ago·May 24, 2023
GitHub

Features

  • parse numeric strings as BigInt on supported systems ([ab79039](https://github.com/niieani/hashids.js/commit/ab7903937094aeef05a101f33d59dd041de6cddb))
2.2.11
github-actions[bot]github-actions[bot]·3y ago·February 16, 2023
GitHub

🐛 Bug Fixes

  • add ".js" extension to type definition import ([#535](https://github.com/niieani/hashids.js/issues/535)) ([f109d55](https://github.com/niieani/hashids.js/commit/f109d55ce42b3f9bcb705e58d2a0b503652f38e2))
2.2.10
github-actions[bot]github-actions[bot]·4y ago·November 20, 2021
GitHub

🐛 Bug Fixes

  • publish source files ([3e6e5ae](https://github.com/niieani/hashids.js/commit/3e6e5ae05412efb14cc3f246470e908d0e6292ff)), related to [#478](https://github.com/niieani/hashids.js/issues/478)
2.2.9
github-actions[bot]github-actions[bot]·4y ago·November 7, 2021
GitHub

🐛 Bug Fixes

  • workaround annoying TS/ESM resolving quirks ([3403edc](https://github.com/niieani/hashids.js/commit/3403edcba721decd6dbf260f0aaeb3db4db8c455))
2.2.8
niieaniniieani·5y ago·December 18, 2020
GitHub

🐛 Bug Fixes

  • resolve eslint issues ([7a9e9f6](https://github.com/niieani/hashids.js/commit/7a9e9f601a2722b35be72d92be1200df92c46391))
2.2.7
niieaniniieani·5y ago·December 18, 2020
GitHub

🐛 Bug Fixes

  • dist version correctly exposes Hashids under global.Hashids instead of global.Hashids.default ([ce93ee9](https://github.com/niieani/hashids.js/commit/ce93ee95fe394a7067f6eadcb37aa89fad812a99)), closes [#314](https://github.com/niieani/hashids.js/issues/314) [#341](https://github.com/niieani/hashids.js/issues/341) [#143](https://github.com/niieani/hashids.js/issues/143)
2.2.6
niieaniniieani·5y ago·December 18, 2020
GitHub

🐛 Bug Fixes

  • export package.json ([#330](https://github.com/niieani/hashids.js/issues/330)) ([b365559](https://github.com/niieani/hashids.js/commit/b36555978d287ed09c97ddc5e5f0990f74b4cfb3))
2.2.5
niieaniniieani·5y ago·December 18, 2020
GitHub

🐛 Bug Fixes

  • remove yarn from the package to make the package smaller ([#338](https://github.com/niieani/hashids.js/issues/338)) ([602ff0c](https://github.com/niieani/hashids.js/commit/602ff0ca55d641567d2b693cfeac97b50ab0db73))
2.2.4
niieaniniieani·5y ago·December 18, 2020
GitHub

🐛 Bug Fixes

  • main field will point to CJS version to support LTS node ([38c93bf](https://github.com/niieani/hashids.js/commit/38c93bffce04091a42d2e2a6e455f5f52687db42)), closes [#352](https://github.com/niieani/hashids.js/issues/352)
2.2.3
niieaniniieani·5y ago·December 13, 2020
GitHub

🐛 Bug Fixes

  • drop browser exports condition ([#342](https://github.com/niieani/hashids.js/issues/342)) ([c01ce33](https://github.com/niieani/hashids.js/commit/c01ce33e093501cdb50982a439c49436e78d8dc2))
2.2.2
niieaniniieani·5y ago·November 7, 2020
GitHub

🐛 Bug Fixes

  • reprioritize browser export ([8c8152a](https://github.com/niieani/hashids.js/commit/8c8152a9b05c6b0eca548a53e1edd693f3fcd04e)), closes [#333](https://github.com/niieani/hashids.js/issues/333)
2.2.1
niieaniniieani·6y ago·February 4, 2020
GitHub

🐛 Bug Fixes

  • avoid string spread so that TypeScript typings do not require `downlevelIteration` when targetting ES5 ([f6bd32c](https://github.com/niieani/hashids.js/commit/f6bd32ceb3e8f009fc283c290acb082d653ccf04)), closes [#171](https://github.com/niieani/hashids.js/issues/171)
  • rework conditional exports to allow requiring index file directly ([b2da180](https://github.com/niieani/hashids.js/commit/b2da1804409c66da8f030c4deafbca590d1f2101)), closes [#207](https://github.com/niieani/hashids.js/issues/207)
2.2.0
niieaniniieani·6y ago·February 3, 2020
GitHub

🐛 Bug Fixes

  • use arrays internally to improve performance ([0ab8b88](https://github.com/niieani/hashids.js/commit/0ab8b88c0f448a4866a4124cde7f360e3be5d3b1)), closes [#79](https://github.com/niieani/hashids.js/issues/79)

Features

  • tune performance by switching to RegExps and reducing iteration ([b395f3d](https://github.com/niieani/hashids.js/commit/b395f3d16c7c448373521126f94732a982f8e341))
2.1.0
niieaniniieani·6y ago·November 9, 2019
GitHub

🐛 Bug Fixes

  • protect from an infinite loop by validating IDs ([bc5b9cf](https://github.com/niieani/hashids.js/commit/bc5b9cf)), closes [#126](https://github.com/niieani/hashids.js/issues/126)

Features

  • add a public method `hashids.isValidId(id)` that validates the ID ([7be1bda](https://github.com/niieani/hashids.js/commit/7be1bda))
2.0.1
niieaniniieani·6y ago·September 6, 2019
GitHub

🐛 Bug Fixes

  • use type error when needed ([b018557](https://github.com/niieani/hashids.js/commit/b018557))
2.0.0
niieaniniieani·6y ago·August 31, 2019
GitHub

💥 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](https://github.com/niieani/hashids.js/commit/20f3df1))

♻️ Code Refactoring

  • constructor: simplify constructor & extract 'shuffle' ([85c7f49](https://github.com/niieani/hashids.js/commit/85c7f49))

Features

  • transparent support of `BigInt`s. 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](https://github.com/niieani/hashids.js/commit/df2c831))
  • lifted the limitation that the alphabet cannot contain spaces ([df2c831](https://github.com/niieani/hashids.js/commit/df2c831))
  • both the alphabet and salt may now contain multi-byte characters (e.g. for an emoji-based alphabet) ([526b6ca](https://github.com/niieani/hashids.js/commit/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@nextPre-release
niieaniniieani·6y ago·August 17, 2019
GitHub

🐛 Bug Fixes

  • only run the esm importing test on node >= 12 ([e9aebcf](https://github.com/niieani/hashids.js/commit/e9aebcf))
2.0.0-prerelease.3@nextPre-release
niieaniniieani·6y ago·August 15, 2019
GitHub

🐛 Bug Fixes

  • build: add TypeScript re-export typings ([875bb27](https://github.com/niieani/hashids.js/commit/875bb27))
2.0.0-prerelease.1@nextPre-release
niieaniniieani·6y ago·August 15, 2019
GitHub

💥 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](https://github.com/niieani/hashids.js/commit/20f3df1))

♻️ Code Refactoring

  • constructor: simplify constructor & extract 'shuffle' ([85c7f49](https://github.com/niieani/hashids.js/commit/85c7f49))

Features

  • transparent support of `BigInt`s. 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](https://github.com/niieani/hashids.js/commit/df2c831))
  • lifted the limitation that the alphabet cannot contain spaces ([df2c831](https://github.com/niieani/hashids.js/commit/df2c831))
  • both the alphabet and salt may now contain multi-byte characters (e.g. for an emoji-based alphabet) ([526b6ca](https://github.com/niieani/hashids.js/commit/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