Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update or replace Node-CRC #365

Closed
rafaelmaeuer opened this issue Mar 21, 2022 · 2 comments · Fixed by #406
Closed

Update or replace Node-CRC #365

rafaelmaeuer opened this issue Mar 21, 2022 · 2 comments · Fixed by #406
Labels
dependencies Pull requests that update a dependency file

Comments

@rafaelmaeuer
Copy link
Contributor

Some thoughts about updating node-crc to v2 like in swrlab/ard-eventhub#284

  • the update would require every project using this dependency to install rustup toolchain which is fine for local development but questionable regarding deployments and docker-files...

The idea came up to replace the library as its only usage is node-utils/utils/ard/createHashedId.js
A not too oudated library is https://github.com/akiver/crc64-ecma, but its not generating the same result:

Result with node-crc: INPUT:SWR --> OUTPUT (CRC64-ECMA182): baa7e9a52223a090

const crc = require('node-crc')
module.exports = (input) => { return crc.crc64(Buffer.from(input, 'utf-8')).toString('hex') }

Result with crc64-ecma: INPUT:SWR --> OUTPUT (CRC64-ECMA182): 7fdca8944f20b7a0

const { crc64 } = require('crc64-ecma')
module.exports = (input) => { return crc64(input).toString(16) }
@rafaelmaeuer rafaelmaeuer added the dependencies Pull requests that update a dependency file label Mar 21, 2022
@rafaelmaeuer
Copy link
Contributor Author

Maybe magiclen/node-crc#9 could be the needed solution?

@rafaelmaeuer rafaelmaeuer linked a pull request Mar 21, 2022 that will close this issue
@rafaelmaeuer
Copy link
Contributor Author

Solution provided in magiclen/node-crc#12

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants