Skip to content

Commit

Permalink
release: v1.41.1
Browse files Browse the repository at this point in the history
  • Loading branch information
surunzi committed Jul 23, 2024
1 parent 4cacaaf commit 8c0c90d
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 3 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## v1.41.1 (23 Jul 2024)

* fix: randomId size over 21 error [#33](https://github.com/liriliri/licia/issues/33)

## v1.41.0 (18 Jun 2024)

* feat: add dataUrl
Expand Down
1 change: 0 additions & 1 deletion lib/update.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ const {
map,
contain,
sortKeys,
escape,
filter,
concat,
unique
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "licia",
"version": "1.41.0",
"version": "1.41.1",
"description": "Useful utility collection with zero dependencies",
"bin": {
"licia": "./bin/licia.js"
Expand Down
2 changes: 1 addition & 1 deletion src/randomId.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ exports = function(size = 21, symbols = defSymbols) {
let id = '';

const len = symbols.length;
const bytes = randomBytes(21);
const bytes = randomBytes(size);
while (0 < size--) {
id += symbols[bytes[size] % len];
}
Expand Down
1 change: 1 addition & 0 deletions test/randomId.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ expect(randomId()).to.be.a('string');
expect(randomId().length).to.equal(21);
expect(randomId(12).length).to.equal(12);
expect(randomId(5, 'a')).to.equal('aaaaa');
expect(randomId(22, 'a')).to.equal('aaaaaaaaaaaaaaaaaaaaaa');

0 comments on commit 8c0c90d

Please sign in to comment.