Skip to content

Commit

Permalink
Pump version to 3.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
nruotsal committed Nov 18, 2023
1 parent be2644e commit 580da45
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 4 deletions.
9 changes: 9 additions & 0 deletions CHANGELOG.md
@@ -1,6 +1,15 @@
# Changelog
This project uses [Semantic Versioning](http://semver.org/)

## 3.0.0 (2023-18-11)
**BREAKING**: Change generate function signature to have separate parameters for reference and options

- Improve randomness and uniqueness of RF references generated without existing reference
- Update dependencies
- Replace deprecated `substr` with `slice`
- Rollup type declaration file
- Improve documentation

## 2.1.2 (2020-01-10)
- [Fix modulo calculation](https://github.com/nruotsal/node-iso11649/pull/180) by [Tol1](https://github.com/Tol1)

Expand Down
2 changes: 1 addition & 1 deletion LICENSE
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2015-2020 Niko Ruotsalainen
Copyright (c) 2015-2023 Niko Ruotsalainen

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
5 changes: 3 additions & 2 deletions dist/index.js
Expand Up @@ -28,7 +28,7 @@ var isValidFormat = function (reference) {
return reference.match(REFERENCE_FORMAT) !== null;
};
var isValidChecksumRange = function (reference) {
var checkSum = Number(reference.substr(2, 2));
var checkSum = Number(reference.slice(2, 4));
return checkSum >= 2 && checkSum <= 98;
};
var isValid = function (reference) {
Expand All @@ -54,7 +54,8 @@ var calculateFinnishChecksum = function (reference) {
return (ceil10(sum) - sum) % 10;
};
var generateFinnishReference = function () {
var reference = "".concat(Date.now());
var random = Math.floor(Math.random() * 1e10);
var reference = "".concat(Date.now() + random);
var checksum = calculateFinnishChecksum(reference);
return "".concat(reference).concat(checksum);
};
Expand Down
2 changes: 1 addition & 1 deletion package.json
@@ -1,6 +1,6 @@
{
"name": "node-iso11649",
"version": "2.1.2",
"version": "3.0.0",
"description": "ISO 11649:2009 creditor reference library for node",
"main": "dist/index.js",
"typings": "dist/types.d.ts",
Expand Down

0 comments on commit 580da45

Please sign in to comment.