UNPKG

5.81 kBMarkdownView Raw
1# CHANGELOG
2
3**2.0.0**:
4
5This is pretty much a TypeScript rewrite.
6
7### Breaking changes
8
9- BREAKING CHANGE: Hashids now throws errors when being constructed with incorrect options (previously, it silently falled back to defaults)
10- BREAKING CHANGE: when used from Node (without ESM enabled), you now need to `require('hashids/cjs')`
11
12### Features
13
14- transparent support of `BigInt`s. If your environment supports them,
15 you can use the standard API to encode and decode them.
16 Note that trying to decode a `BigInt` hashid on an unsupported environment will throw an error.
17- lifted the limitation that the alphabet cannot containin spaces
18- both the alphabet and salt may now contain multi-byte characters (e.g. for an emoji-based alphabet)
19
20### Chores
21
22- upgraded all dependencies
23- tests now use `jest` testing framework
24- extracted static methods to helper functions
25- converted the implementation to TypeScript
26- added `prettier`
27- added stricter `eslint` rules
28
29**1.2.2**:
30
31- another issue https://github.com/ivanakimov/hashids.js/issues/56
32
33**1.2.1** (do not use):
34
35- fixes a bug issue https://github.com/ivanakimov/hashids.js/issues/54
36
37**1.2.0** (do not use):
38
39- drop unsupported node versions (6 and above is still supported)
40- drop support for browsers with global market share < 0.5%
41- upgrade to babel 7 and update other `devDependencies`
42- expose both as a default and a commonjs export (fixes TypeScript typings)
43- add support for `.mjs`
44- `package.json` updates
45- `.gitattributes` marks `package-lock.json` as binary
46- path of the source file changed from `dist/hashids.min.map` to `dist/hashids.min.js.map`
47- minor regex cleanup
48- precommit hook to run lint and test
49
50**1.1.4**:
51
52- looks like some bad input could generate negative numbers, which when passed to `_encode` would crash because it can't handle those <https://github.com/ivanakimov/hashids.js/issues/34>
53 _NOTE:_ do not use `1.1.3`, it wasn't re-built
54
55**1.1.2**:
56
57- fixed issue with sourceMappingURL in hashids.min.js ([PR #38](https://github.com/ivanakimov/hashids.js/pull/38))
58- added `package-lock.json`
59
60**1.1.1**:
61
62- Enforce stricter integer parsing on encode function ([PR #24](https://github.com/ivanakimov/hashids.js/pull/24))
63- Moved source from `hashids.js` to `lib/hashids.js`
64- Minor `README.md` cleanup
65
66**1.1.0**:
67
68- ES6 source; ES5 dist
69- UMD support ([Node.js repo](https://github.com/ivanakimov/hashids.node.js) is merging into this one)
70- Added Eslint (npm run lint)
71- Added Mocha (npm run test)
72- Added Coveralls (npm run coverage)
73- Added build script (npm run build)
74- Moved CHANGELOG out of `README.md`
75- `README.md` completely updated
76- `examples/` folder removed; all examples are now in the README
77- [Bug fix](https://github.com/ivanakimov/hashids.node.js/issues/26): escaping regex
78- Improvement: relaxed parameter checks to `encode()`. All of these are allowed:
79
80 ```javascript
81 var hashids = new Hashids();
82
83 hashids.encode(1, 2, 3); // o2fXhV
84 hashids.encode([1, 2, 3]); // o2fXhV
85 hashids.encode('1', '2', '3'); // o2fXhV
86 hashids.encode(['1', '2', '3']); // o2fXhV
87 ```
88
89**1.0.2**:
90
91- Support for older browsers (using `charAt`) by [@tauanz](https://github.com/tauanz): <https://github.com/ivanakimov/hashids.js/pull/15>
92
93**1.0.1**:
94
95- _require.js_ support by [@nleclerc](https://github.com/nleclerc): <https://github.com/ivanakimov/hashids.js/pull/12>
96
97**1.0.0**:
98
99- Several public functions are renamed to be more appropriate: - Function `encrypt()` changed to `encode()` - Function `decrypt()` changed to `decode()` - Function `encryptHex()` changed to `encodeHex()` - Function `decryptHex()` changed to `decodeHex()`
100
101 Hashids was designed to encode integers, primary ids at most. We've had several requests to encrypt sensitive data with Hashids and this is the wrong algorithm for that. So to encourage more appropriate use, `encrypt/decrypt` is being "downgraded" to `encode/decode`.
102
103- Version tag added: `1.0`
104- `README.md` updated
105
106**0.3.0**:
107
108**PRODUCED HASHES IN THIS VERSION ARE DIFFERENT THAN IN 0.1.4, DO NOT UPDATE IF YOU NEED THEM TO KEEP WORKING:**
109
110- Same algorithm as [PHP](https://github.com/ivanakimov/hashids.php) and [Node.js](https://github.com/ivanakimov/hashids.node.js) versions now
111- Overall approximately **4x** faster
112- Consistent shuffle function uses slightly modified version of [Fisher–Yates algorithm](http://en.wikipedia.org/wiki/Fisher%E2%80%93Yates_shuffle#The_modern_algorithm)
113- Generate large hash strings faster (where _minHashLength_ is more than 1000 chars)
114- When using _minHashLength_, hash character disorder has been improved
115- Basic English curse words will now be avoided even with custom alphabet
116- _encrypt_ function now also accepts array of integers as input
117- Passing JSLint now
118- Support for [Bower](http://bower.io/) package manager
119
120**0.1.4**:
121
122- Global var leak for hashSplit (thanks to [@BryanDonovan](https://github.com/BryanDonovan))
123- Class capitalization (thanks to [@BryanDonovan](https://github.com/BryanDonovan))
124
125**0.1.3**:
126
127 Warning: If you are using 0.1.2 or below, updating to this version will change your hashes.
128
129- Updated default alphabet (thanks to [@speps](https://github.com/speps))
130- Constructor removes duplicate characters for default alphabet as well (thanks to [@speps](https://github.com/speps))
131
132**0.1.2**:
133
134 Warning: If you are using 0.1.1 or below, updating to this version will change your hashes.
135
136- Minimum hash length can now be specified
137- Added more randomness to hashes
138- Added unit tests
139- Added example files
140- Changed warnings that can be thrown
141- Renamed `encode/decode` to `encrypt/decrypt`
142- Consistent shuffle does not depend on md5 anymore
143- Speed improvements
144
145**0.1.1**:
146
147- Speed improvements
148- Bug fixes
149
150**0.1.0**:
151
152- First commit